# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
195357 | kdh9949 | Werewolf (IOI18_werewolf) | C++17 | 1998 ms | 149496 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 = 200005, LG = 18;
int n, q, p[2 * N], tim[2][2 * N], sgs[2][2 * N], sge[2][2 * N], cnt;
int sp[2][LG][2 * N];
vector<int> e[N], t[2 * N];
struct Qry{ int i, s, e, sgn; };
vector<Qry> qv[N];
vector<int> pos[N];
int f(int x){ return p[x] = (x == p[x] ? x : f(p[x])); }
void aft(int id, int x){
if(x < n){
sgs[id][x] = sge[id][x] = ++cnt;
return;
}
sgs[id][x] = N;
for(int i : t[x]){
aft(id, i);
sgs[id][x] = min(sgs[id][x], sgs[id][i]);
sge[id][x] = max(sge[id][x], sge[id][i]);
}
}
struct Fen{
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... |