# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
320440 | mihai145 | Werewolf (IOI18_werewolf) | C++14 | 3044 ms | 314656 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 <iostream>
#include <vector>
#include <set>
#include <algorithm>
const int NMAX = 2e5;
const int LOGMAX = 18;
int _N, M, Q;
std::vector <int> g[NMAX + 2];
int dadSmall[NMAX + 2], dadBig[NMAX + 2];
std::vector <int> dsuSmall[NMAX + 2]; ///in subtree[x] am toate nodurile reach-able <= x
std::vector <int> dsuBig[NMAX + 2]; ///in subree[x] am toate nodurile reach-able >= x
int RootSmall(int x) {
if(x == dadSmall[x])
return x;
return dadSmall[x] = RootSmall(dadSmall[x]);
}
int RootBig(int x) {
if(x == dadBig[x])
return x;
return dadBig[x] = RootBig(dadBig[x]);
}
# | 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... |