generated from TNFSH-Programming-Contest/tps-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgen.cpp
55 lines (53 loc) · 1.43 KB
/
gen.cpp
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
#include <bits/stdc++.h>
#include "testlib.h"
using namespace std;
int main(int argc, char* argv[]) {
registerGen(argc, argv, 1);
int subtask=atoi(argv[1]);
int a, b, c, d, n;
if(subtask==1){
n = rnd.next(1000, 100000);
a = rnd.next(1, 10000000);
b = rnd.next(1, 10000000);
c = rnd.next(1, 10000000);
d = rnd.next(1, 10000000);
cout << n << ' ' << a << ' ' << b << ' ' << c << ' ' << d << endl;
for(int i=1;i<=n;i++){
if(i%3==1){
cout << rnd.next(1, 100) << " \n"[i==n];
}else if(i%3==2){
cout << rnd.next(1000, 10000) << " \n"[i==n];
}else if(i%3==0){
cout << rnd.next(500000, 1000000) << " \n"[i==n];
}
}
}else if(subtask==2){
n = rnd.next(1000, 100000);
a = rnd.next(1, 10000000);
b = rnd.next(1, 10000000);
c = rnd.next(1, 10000000);
d = rnd.next(1, 10000000);
cout << n << ' ' << a << ' ' << b << ' ' << c << ' ' << d << endl;
int cc = rnd.next(100000000, 1000000000);
for(int i=1;i<=n;i++){
cout << cc << " \n"[i==n];
}
}else{
n = 100000;
a = rnd.next(1, 10000000);
b = rnd.next(1, 10000000);
c = rnd.next(1, 10000000);
d = rnd.next(1, 10000000);
cout << n << ' ' << a << ' ' << b << ' ' << c << ' ' << d << endl;
for(int i=1;i<=n;i++){
if(i%3==1){
cout << rnd.next(1, 100) << " \n"[i==n];
}else if(i%3==2){
cout << rnd.next(10000, 1000000) << " \n"[i==n];
}else if(i%3==0){
cout << rnd.next(100000000, 1000000000) << " \n"[i==n];
}
}
}
return 0;
}