# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
200001 | jeff | Werewolf (IOI18_werewolf) | C++14 | 962 ms | 100064 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>
#include "werewolf.h"
using namespace std;
int N, A[800000], id[400000], f[200000], l[2][2][400000], y, z;
pair<int, int> B[800000];
vector<int> adj[2][400000], rs;
vector<pair<int, int> > v;
vector<tuple<int, int, int, int, int> > qr;
inline int frt(int i) {return i == id[i] ? i : id[i] = frt(id[i]);}
inline void ufds(int t, int a, int b) {
a = frt(a);
b = frt(b);
if (a == b) return;
adj[t][a].push_back(y);
adj[t][b].push_back(y);
adj[t][y].push_back(a);
adj[t][y].push_back(b);
id[a] = id[b] = y++;
}
void it(int t, int i, int o) {
l[t][0][i] = z;
for (int j = 0; j < adj[t][i].size(); ++j) if (o != adj[t][i][j]) it(t, adj[t][i][j], i);
if (i < N) {
if (!t) f[z++] = i;
else ++z;
}
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... |