Instantly share code, notes, and snippets.

@yosupo06 /maker.cpp Secret
Created Oct 2, 2015

Embed
What would you like to do?
#include <iostream>
#include <cstdio>
#include <cassert>
#include <cstring>
#include <vector>
#include <valarray>
#include <array>
#include <queue>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <complex>
#include <random>
using namespace std;
typedef long long ll;
int genInt(int r) {
return rand() % r;
}
int main() {
srand(time(NULL));
int n = (1<<17)-1;
int q = 1000000;
printf("%d %d\n", n, q);
cerr << n << endl;
for (int i = 0; i < n; i++) {
printf("%d ", genInt(20001) - 10000);
} printf("\n");
for (int i = 1; i < n; i++) {
printf("%d %d\n", (i+1)/2, i+1);
}
for (int i = 0; i < q; i++) {
int ty = genInt(2); ty++;
int a, b;
while (true) {
a = genInt(n);
b = genInt(n);
if (a != b) break;
}
a++; b++;
if (ty == 1) {
int c = genInt(20001) - 10000;
printf("%d %d %d %d\n", ty, a, b, c);
} else if (ty == 2) {
printf("%d %d %d %d\n", ty, a, b, 0);
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment