# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
379243 | Sorting | Werewolf (IOI18_werewolf) | C++17 | 764 ms | 101352 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 N = 2e5 + 3;
const int LOGN = 19;
vector<int> adj[N], ans, tr[2][N], tour[2];
vector<array<int, 2>> sweepline[N];
int n, q, s[N], e[N], l[N], r[N];
int st[2][N], en[2][N], par[2][N], lca[LOGN][N], pos[N];
struct DSU{
int sz[N], p[N], head[N];
DSU(){}
void init(){
for(int i = 0; i < n; ++i)
sz[i] = 1, p[i] = i, head[i] = i;
}
int get_p(int x){
if(x == p[x]) return x;
return p[x] = get_p(p[x]);
}
bool unite(int a, int b, int idx){
a = get_p(a), b = get_p(b);
if(a == b) return false;
if(sz[a] < sz[b]) swap(a, b);
sz[a] += sz[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... |