-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgen.cpp
More file actions
52 lines (45 loc) · 1.25 KB
/
Copy pathgen.cpp
File metadata and controls
52 lines (45 loc) · 1.25 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
#include <bits/stdc++.h>
using namespace std;
#define flush cout.flush
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pl = pair<ll, ll>;
const ll INF = 1e9 + 7;
const ll mod = 1e9 + 7;
const ll mod2 = 998244353;
const ld eps = 1e-9;
const ld PI = acos(-1);
int main(int argc, char **argv) {
ios::sync_with_stdio(false);
cin.tie(NULL);
if (argc < 4) {
std::cout << "Not enough params" << std::endl;
return 0;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int n = stoi(argv[1]);
int m = stoi(argv[2]);
int q = stoi(argv[3]);
ofstream nodes("n_gen.txt");
ofstream edges("e_gen.txt");
ofstream queries("q_gen.txt");
vector<ll> p(n);
iota(p.begin(), p.end(), 0);
shuffle(p.begin(), p.end(), rng);
for (int i = 0; i < n; ++i) {
nodes << p[i] + 1 << " " << rng() % 90 << " " << rng() % 90 << "\n";
}
for (int i = 0; i < m; ++i) {
int k = rng() % 4 + 2;
edges << k << " ";
for (int j = 0; j < k; ++j) {
edges << rng() % n + 1 << " ";
}
edges << "\n";
}
for (int i = 0; i < q; ++i) {
queries << rng() % n + 1 << " " << rng() % n + 1 << "\n";
}
return 0;
}