제출 #599964

#제출 시각아이디문제언어결과실행 시간메모리
599964daisy2게임 (IOI14_game)C++14
0 / 100
111 ms262144 KiB
#include "game.h" using namespace std; int par[1505],con[1505],b[1505]; void initialize(int n) { for(int i=1;i<=n;i++) { par[i]=i; con[i]=1; b[i]=n-1; } } int find_par(int vr) { if(vr==par[vr]) return vr; return par[vr]=find_par(vr); } int hasEdge(int u, int v) { u++;v++; u=find_par(u);b[u]--; v=find_par(v);b[v]--; if(u==v) return 1; if(b[u]==0 || b[v]==0) { par[v]=u; con[v]+=con[u];con[u]=con[v]; return 1; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...