# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
312926 | reymontada61 | Werewolf (IOI18_werewolf) | C++14 | 2594 ms | 218144 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;
const int MXN = 400005, MXK = 20;
int par[MXN][2];
int nextnode[2];
vector<int> subs[MXN][2];
int value[MXN][2];
int parent(int w, int n) {
if (par[n][w] == n) return n;
return par[n][w] = parent(w, par[n][w]);
}
void connect(int w, int a, int b, int val) {
a = parent(w, a);
b = parent(w, b);
if (a == b) return;
int c = nextnode[w];
nextnode[w]++;
par[a][w] = c;
par[b][w] = c;
subs[c][w].push_back(a);
subs[c][w].push_back(b);
}
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... |