# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
809050 | math_rabbit_1028 | Werewolf (IOI18_werewolf) | C++14 | 1428 ms | 257564 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 "werewolf.h"
#include <bits/stdc++.h>
using namespace std;
int n, m, q;
vector<int> adj[202020];
struct disjoint {
int root[202020], num[202020];
int r, mn[404040], mx[404040], par[404040];
vector<int> child[404040];
int _find(int v) {
if (v == root[v]) return v;
else return root[v] = _find(root[v]);
}
void _union(int v, int u) {
v = _find(v);
u = _find(u);
if (v == u) return;
if (v > u) swap(u, v);
root[u] = v;
child[r].push_back(num[v]);
child[r].push_back(num[u]);
par[num[v]] = par[num[u]] = r;
mn[r] = min(mn[num[v]], mn[num[u]]);
mx[r] = max(mx[num[v]], mx[num[u]]);
num[v] = r;
r++;
}
int ord[808080], lt[404040], rt[404040], s, inv[202020];
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |