-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgen.cpp
More file actions
64 lines (59 loc) · 1.36 KB
/
gen.cpp
File metadata and controls
64 lines (59 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//author Naresh
#include <algorithm>
#include <bitset>
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ctype.h>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define all(a) a.begin(),a.end()
#define rep(i, a, b) for(int i=(a); i<(b); ++i)
#define irep(i, a, b) for(int i=(a); i>=(b); --i)
#define iter(i,v) for(auto &i : (v))
typedef long long ll;
// random generator
template<class T> inline void println(T t) { cout << t << endl; }
template<class T> inline void prints(T t) { cout << t << " "; }
inline int randint(int max) { return rand()%max; }
inline int randint(int min, int max) { return randint(max-min+1)+min; }
double randreal(double l, double u) {
std::uniform_real_distribution<double> unif(l,u);
static std::default_random_engine re(time(0));
return unif(re);
}
int main() {
srand(time(0));
int n = 100000;
int mm = 1000000;
println(n);
rep(i, 0, n) {
prints(randint(2, mm));
}
println("");
int q = n;
println(q);
rep(i, 0, q) {
int l = randint(1, n-1);
int r = randint(l+1, n);
int x = randint(1, mm-1);
int y = randint(x, mm);
prints(l);
prints(r);
prints(x);
println(y);
}
return 0;
}