제출 #384742

#제출 시각아이디문제언어결과실행 시간메모리
384742BlancaHM게임 (IOI14_game)C++14
0 / 100
1 ms364 KiB
#include <iostream> #include <vector> using namespace std; vector<int> par, rnk; int root(int a) { if (a == par[a]) return a; return par[a] = root(par[a]); } void merge(int i, int j) { int a = root(i), b = root(j); if (a == b) return; if (rnk[a] < rnk[b]) par[a] = b; else if (rnk[a] > rnk[b]) par[b] = a; else { par[b] = a; rnk[b]++; } } void initialize(int N) { par = vector<int>(N); for (int i = 0; i < N; i++) par[i] = i; rnk.assign(N, 0); } int hasEdge(int u, int v) { if (u > v) return 1; else return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...