Skip to content

Instantly share code, notes, and snippets.

@yosupo06
Created October 2, 2015 13:59
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save yosupo06/f1ee98a53c1d94b7aa27 to your computer and use it in GitHub Desktop.
#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