-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgen.cpp
More file actions
57 lines (51 loc) · 1.51 KB
/
gen.cpp
File metadata and controls
57 lines (51 loc) · 1.51 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
#include <bits/stdc++.h>
#ifdef local
#define debug(args...) qqbx(#args, args)
template <typename ...T> void qqbx(const char *s, T ...args) {
int cnt = sizeof...(T);
((std::cerr << "\e[032;1m(" << s << ") = (") , ... , (std::cerr << args << (--cnt ? ", " : ")\e[0m\n")));
}
#else
#define debug(...) ((void)0)
#endif // local
#define all(v) begin(v),end(v)
#define pb emplace_back
using namespace std;
const int maxn = 100025, mod = 998244353, inf = 1e9, maxc = 100025;
const int64_t INF = 1e18;
signed main(int argc, char **argv) {
assert (argc >= 2);
ios_base::sync_with_stdio(0), cin.tie(0);
const int seed = atoi(argv[1]);
mt19937 rng(seed);
vector<vector<int>> perms;
int cnt = 0;
for (int N = 2; N <= 8; N++) {
vector<int> perm(N);
iota(all(perm), 0);
do {
perms.emplace_back(perm);
cnt += perm.size();
} while (next_permutation(all(perm)));
}
// for (int it = 0; it < 5; it++) {
// int N = 1000000;
// vector<int> p(N);
// for (int i = 0; i < N; i++) {
// p[i] = (i & 1 ? N - i/2 : i/2);
// }
// cnt += N;
// perms.emplace_back(p);
// }
shuffle(perms.begin(), perms.end(), rng);
int T = perms.size();
debug(cnt, T);
cout << T << '\n';
for (const auto &perm: perms) {
int N = perm.size() - 1;
cout << N << '\n';
for (int i = 1; i <= N; i++) {
cout << perm[i] - perm[i-1] << (i==N ? '\n' : ' ');
}
}
}