Skip to content

Instantly share code, notes, and snippets.

@xdoju xdoju/2655_gen.cpp Secret
Created Oct 30, 2016

Embed
What would you like to do?
#include <cstdio>
#include <chrono>
#include <random>
using namespace std;
mt19937 R;
bool Svs[1010], Wvs[1010];
int r(int x, int y){ return R() % (y - x + 1) + x; }
int main(){
R.seed(chrono::system_clock::now().time_since_epoch().count());
int N = 100; printf("%d\n", N);
for(; N--; ){
int s = r(1, 1000), w = r(1, 1000);
while(Svs[s] || Wvs[w]){ s = r(1, 1000); w = r(1, 1000); }
printf("%d %d %d\n", s, r(1, 1000), w);
Svs[s] = Wvs[w] = true;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.