# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
619489 | Vanilla | Werewolf (IOI18_werewolf) | C++17 | 835 ms | 124020 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>
using namespace std;
typedef long long int64;
const int maxn = 2e5 + 2;
const int lg = 20;
vector <int> ad [maxn];
vector <int> reach [2][maxn];
int dsu [maxn];
int bit [maxn * 2 + 200];
int up [2][maxn][lg];
int in [2][maxn];
int val [2][maxn];
int sz [2][maxn];
int ps = 2;
int dad (int x) {
return dsu[x] = (x == dsu[x] ? x: dad(dsu[x]));
}
void dfs (int t, int u) {
in[t][u] = ++ps, sz[t][u] = 1;
for (int i = 1; i < lg; i++){
up[t][u][i] = up[t][up[t][u][i-1]][i-1];
}
for (int v: reach[t][u]) {
up[t][v][0] = u;
dfs(t, v);
sz[t][u]+=sz[t][v];
}
}
# | 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... |