# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
588670 | georgievskiy | Werewolf (IOI18_werewolf) | C++17 | 1148 ms | 123100 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;
struct DSU {
vector<vector<int>> g;
vector<int> link;
vector<int> euler, l, r;
DSU(int n) {
g.resize(n), link.resize(n);
l.resize(n), r.resize(n);
iota(link.begin(), link.end(), 0);
}
int getP(int x) {
if (link[x] == x) return x;
return link[x] = getP(link[x]);
}
void unite(int dad, int son) {
dad = getP(dad), son = getP(son);
if (dad == son) return;
link[son] = dad;
g[dad].push_back(son);
}
void dfs(int v) {
l[v] = euler.size();
euler.push_back(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... |