제출 #1207284

#제출 시각아이디문제언어결과실행 시간메모리
1207284candi_ositos게임 (IOI14_game)C++20
0 / 100
0 ms328 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; vector <int> p; vector <int> joke; int N; void initialize(int n) { N=n; joke.assign(n, 1); p.resize(n); for(int i=0; i<n; ++i) { p[i]=i; } } int fgp(int a) { if(p[a]==a) { return a; } return p[a]=fgp(p[a]); } int hasEdge(int u, int v) { if(joke[fgp(u)]>=N-1 || joke[fgp(v)]>=N-1) { p[fgp(u)]=v; return 1; } ++joke[fgp(u)]; ++joke[fgp(v)]; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...