# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
155451 | Mercenary | Werewolf (IOI18_werewolf) | C++14 | 999 ms | 111608 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 = 2e5 + 5;
const int logn = log2(maxn) + 1;
vector<int> e[maxn] , adj[maxn] , radj[maxn];
int lab[maxn];
int in[2][maxn] , out[2][maxn] , id[2][maxn];
int nTime = 0;
int P[2][maxn][logn];
int n;
#define pb push_back
void DFS(int u , int par , vector<int> adj[] , int in[] , int out[] , int id[] , int P[maxn][logn]){
P[u][0] = par;
for(int i = 1 ; i < logn ; ++i){
if(P[u][i - 1] >= 0 && P[u][i - 1] < n)P[u][i] = P[P[u][i - 1]][i - 1];
else P[u][i] = P[u][i - 1];
}
in[u] = ++nTime;
id[nTime] = u;
for(int c : adj[u]){
DFS(c , u , adj , in , out, id , P);
}
out[u] = nTime;
}
int bit[maxn];
void add(int x){
for(;x <= n ;x += x & -x){
bit[x]++;
# | 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... |