# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
208989 | spdskatr | Werewolf (IOI18_werewolf) | C++14 | 1688 ms | 156760 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 <cstdio>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <utility>
#include <functional>
#include <cassert>
#define fi first
#define se second
#define SZ (1<<18)
using namespace std;
typedef pair<int, pair<int, int>> EDGE;
int N, M, Q;
vector<int> ans;
EDGE edges[400005];
class KRT {
int uf[400005], rep[400005], cnt, cnt2;
int f(int x) { if (x == uf[x]) return x; return uf[x] = f(uf[x]); }
void un(int x, int y) {
rep[f(y)] = cnt;
uf[f(x)] = f(y);
}
public:
int seq[400005], val[400005], lc[400005], rc[400005], pos[400005], sz[400005];
int jp[400005][20];
int dfs(int x, int rev) {
if (x < N) {
# | 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... |