제출 #465403

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
4654032021-08-15 21:25:05dutch늑대인간 (IOI18_werewolf)C++17
100 / 100
653 ms60312 KiB
#include <bits/stdc++.h>
using namespace std;
#include "werewolf.h"
typedef vector<int> vi;
#define vii(Z) iota(begin(Z), end(Z), 0)
const int Z = 2e5;
int Q, k, dfsTimer;
int e[Z], r[Z], lca[2][Z], st[2*Z], tL[2][Z], tR[2][Z];
vi g[2][Z], g2[Z];
int find(int u){
return e[u] < 0 ? u : e[u] = find(e[u]);
}
void dfs(int u){
tL[k][u] = ++dfsTimer;
for(int &v : g2[u]) dfs(v);
tR[k][u] = dfsTimer;
}
vi check_validity(int N, vi X, vi Y, vi S, vi E, vi L, vi R){
Q = size(S);
for(int i=size(X); --i>=0; ){
if(X[i] > Y[i]) swap(X[i], Y[i]);
g[0][Y[i]].push_back(X[i]);
g[1][X[i]].push_back(Y[i]);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...