蒟蒻求救

回复帖子

@scp_05_tqr 2019-03-15 21:18 回复

想生成一些随机数据,不过同一秒的数据实在太接近了,求大佬帮忙

#include<bits/stdc++.h>
#define ll long long
using namespace std;

ll random(ll x){return (ll)rand()*rand()*rand()+(long long)new int;}

int main()
{
    freopen("1.in","w",stdout);

    srand((unsigned)time(NULL));srand(rand());
    long long n=random(2147483647)%5000+1;
    cout<<n<<endl;

    for(int i=1;i<=n;i++)
    {
        srand((unsigned)time(NULL));srand(rand());
        long long y=random(random(random(1000000000000)))%10000000000000000+1;
        cout<<y<<".";
        srand((unsigned)time(NULL));srand(rand());
        long long m=random(random(random(1000000000000)))%12+1;
        cout<<m<<".";
        srand((unsigned)time(NULL));srand(rand());
        long long d=random(random(random(1000000000000)))%28+1;
        cout<<d<<endl;
    }
}
@scp_05_tqr 2019-03-15 21:20 回复

是不是一定要有一个回复你们才会进来啊

@✡Dustaria✡ 2019-03-15 21:21 回复

srand里加上(long long)(new int)也许有效?

还有为什么不用mt19937

@Microsoft_ZGB 2019-03-15 21:26 回复

多生成几组数据来搞

您不应该手搓数据吗?(Orz毒瘤出题人),怎么用rand()了?(手动滑稽)