# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
207951 | red1108 | Werewolf (IOI18_werewolf) | C++17 | 1010 ms | 155516 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;
#define fi first
#define se second
typedef pair<int,int> pii;
int n, m;
//1 이 N->1, 2가 1->N순서
vector<int> tree1[200010], tree2[200010], gr[200010];
pii rn1[200010], rn2[200010];
int mi[20][200010], ma[20][200010], par1[20][200010], par2[20][200010];
int anc[200010], ord;
int nh[200010], root[200010];
int findanc(int x){
if(x==anc[x]) return x;
return anc[x]=findanc(anc[x]);
}
void dfs1(int x, int par){
//printf("dfs1(%d %d)\n", x, par);
mi[0][x] = par;
par1[0][x]=par;
rn1[x].fi = ++ord;
for(auto i:tree1[x]) if(i!=par){
dfs1(i,x);
}
rn1[x].se = ord;
}
void dfs2(int x, int par){
//printf("dfs2(%d %d)\n", x, par);
# | 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... |