haozexu @ 2024-08-21 16:46:31
#include<bits/stdc++.h>
#include<chrono>
#include<random>
using namespace std;
long long get_time_stamp(){
return chrono::duration_cast<chrono::nanoseconds>(chrono::high_resolution_clock::now().time_since_epoch()).count();
}
struct Rand{
mt19937_64 *rnd;
Rand(){rnd=new mt19937_64(get_time_stamp());}
Rand(long long x){rnd=new mt19937_64(x);}
~Rand(){delete rnd;}
long long operator()(long long l,long long r){
return (*rnd)()%(r-l+1)+l;
}
}rnd;
int main(){
int n=rnd(1,10),m=5;
cout<<n<<" "<<m<<"\n";
vector<int> rcd;
for(int i=1;i<=n;i++) rcd.emplace_back(i);
for(int i=1;i<=n;i++) swap(rcd[rnd(0,n-1)],rcd[rnd(0,n-1)]);
for(int i=1;i<n;i++){
int c=rnd(0,i-1);
cout<<rcd[c]<<" "<<rcd[i]<<" "<<rnd(1,8)<<"\n";
}
for(int i=1;i<=m;i++) cout<<rnd(1,8)<<"\n";
return 0;
}
附赠对拍器(带进度条/用时显示)
by PCwqyy @ 2024-08-22 12:05:31
《附赠对拍器》