# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
931555 | nguyentunglam | Simurgh (IOI17_simurgh) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define endl "\n"
#define int long long
using namespace std;
const int N = 510 + 01;
int a[N][N];
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937 rng(1417415151);
long long rnd(long long l, long long r) {
return l + rng() % (r - l + 1);
}
int u[510], v[510];
int32_t main() {
for(int test = 1; test <= 100000; test ++) {
cerr << "Test Case #" << test << ":.....\n";
ofstream cout ("task.inp");
int n = rnd(4, 5), m = rnd(1, 4);
m = min(m, n * (n - 1) / 2 - n + 1);
vector<pair<int, int> > e;
map<pair<int, int>, int> dd;
for(int i = 1; i < n; i++) {
int u = rnd(0, i - 1), v = i;
dd[{u, v}] = dd[{v, u}] = i;
e.emplace_back(u, v);
}
while (m--) {
int u = rnd(0, n - 1), v = rnd(0, n - 1);
while (u == v || dd[{u, v}]) u = rnd(0, n - 1), v = rnd(0, n - 1);
e.emplace_back(u, v);
dd[{u, v}] = dd[{v, u}] = -1;
}
shuffle(e.begin(), e.end(), rng);
cout << n << " " << e.size() << endl;
for(auto &[x, y] : e) cout << x << " " << y << endl;
for(int i = 0; i < e.size(); i++) {
int u, v; tie(u, v) = e[i];
if (dd[{u, v}] > 0) cout << i << " ";
}
cout.close();
if (system("grader.exe") == 3) exit(0);
// if (system("trau.exe") == 3) exit(0);
// if (system ("fc task.out task.ans")) exit(0);
}
}