This repository has been archived on 2026-11-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
csps2026/subway/gen.cpp
T
2026-11-01 00:51:03 +08:00

33 lines
888 B
C++

#include<bits/stdc++.h>
using namespace std;
mt19937 ran(time(0));
int n, m, q;
int main() {
freopen("in", "w", stdout);
n = ran() % 500 + 1;
m = ran() % 20000 + 1;
q = ran() % 200 + 1;
printf("0 %d %d 20 %d\n", n, m, q);
for(int i = 1; i <= m; ++i) {
printf("%d ", ran() % (1000000000) + 1);
}
putchar('\n');
for(int i = 1; i <= n; ++i) {
bool vis[m + 1] = {0};
int k = ran() % m + 1;
printf("%d ", k);
for(int j = 1; j <= k; ++j) {
int sta = ran() % m + 1;
while(vis[sta + 1]) sta = ran() % m + 1;
vis[sta] = 1;
printf("%d %d ", sta, ran() % (1000000000) + 1);
}
putchar('\n');
}
while(q--) {
int x = ran() % m + 1, y = ran() % m + 1;
while(x == y) x = ran() % m + 1;
printf("%d %d\n", x, y);
}
return 0;
}