Submission #75006

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
750062018-09-08 03:11:11aintaWerewolf (IOI18_werewolf)C++17
100 / 100
1850 ms146652 KiB
#include "werewolf.h"
#include<algorithm>
#include<vector>
#define N_ 201000
#define M_ 401000
using namespace std;
int n, m, Q, UF[N_], par[N_][2][20], Num[N_][2], Ed[N_][2], cnt, ReNum[N_][2];
vector<int> UU[N_], DD[N_];
vector<int> T[N_][2];
int Find(int a) {
if (a == UF[a])return a;
return UF[a] = Find(UF[a]);
}
void DFS(int a, int ck) {
Num[a][ck] = ++cnt;
ReNum[cnt][ck] = a;
for (auto &x : T[a][ck]) {
par[x][ck][0] = a;
DFS(x, ck);
}
Ed[a][ck] = cnt;
}
struct PST {
int l, r, s;
}IT[N_*20];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...