Instantly share code, notes, and snippets.

@yosupo06 /maker.cpp Secret
Last active Oct 30, 2015

Embed
What would you like to do?
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <map>
#include <cassert>
#include <set>
#include <cstring>
#include <complex>
#include <random>
using namespace std;
typedef long long ll;
typedef tuple<int, int, int, int> T;
random_device rd;
mt19937 gen(rd());
vector<T> v;
void copyq(int a, int b, int c, int d) {
v.push_back(T(a, b, c, d));
}
int main() {
const int n = 90000;
int q = 0;
for (int i = 1; i <= n; i++) {
q++;
copyq(i, 2*i, 0, i);
if (uniform_int_distribution<int>(0, 30)(gen) == 0) {
q++;
copyq(0, i+1, i-1, 2*i);
}
}
for (int i = 1; i <= n; i++) {
q++;
copyq(2*n-2*i, 2*n-i, 2*n-i, 2*n);
if (uniform_int_distribution<int>(0, 30)(gen) == 0) {
q++;
copyq(2*n-(i+1), 2*n, 2*n-2*i, 2*n-i+1);
}
}
printf("%d %d\n", 2*n, q);
for (int i = 1; i <= 2*n; i++) {
printf("%d", 0);
if (i != 2*n) {
printf(" ");
} else {
printf("\n");
}
}
for (auto t: v) {
int a, b, c, d;
tie(a, b, c, d) = t;
printf("2 %d %d %d %d\n", a+1, b, c+1, d);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment