제출 #1104680

#제출 시각아이디문제언어결과실행 시간메모리
1104680Toto게임 (IOI14_game)C++14
0 / 100
1 ms504 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; int a[1501],n,g[1501]; int root(int num){ if(num==a[num])return num; a[num]=root(a[num]); return a[num]; } void initialize(int num) { n=num; for(int i=0;i<n;i++){ a[i]=i; g[i]=n-1; } } int hasEdge(int u, int v) { int n1=root(u),n2=root(v); g[n1]--; g[n2]--; if(g[n1]&&g[n2])return 0; else { g[min(n1,n2)]=g[n1]+g[n2]; a[n1]=min(n1,n2); a[n2]=min(n1,n2); return 1; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...