# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
170524 | oolimry | Werewolf (IOI18_werewolf) | C++14 | 786 ms | 81252 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;
const int maxN = 400000;
typedef pair<int,int> ii;
struct UFDS{
int p[maxN];
void reset(int n){
for(int i = 0;i < n;i++) p[i] = i;
}
int findSet(int u){
if(p[u] == u) return u;
else{
p[u] = findSet(p[u]);
return p[u]; ///use path compression only
}
}
void unionSet(int u, int v){
u = findSet(u);
v = findSet(v);
if(u == v) return;
if(u > v) swap(u,v);
p[u] = v; ///don't union by rank, instead return the largest value to make tree building easier
}
};
struct query{
int start;
# | 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... |