제출 #340730

#제출 시각아이디문제언어결과실행 시간메모리
340730nandonathaniel게임 (IOI14_game)C++14
0 / 100
1 ms364 KiB
#include "game.h" #include "bits/stdc++.h" using namespace std; int par[1505],N; int byk[1505]; int find(int x){ if(par[x]==x)return x; return par[x]=find(par[x]); } void join(int a,int b){ par[find(a)]=find(b); } void initialize(int n) { N=n; for(int i=0;i<n;i++)par[i]=i; } int hasEdge(int u, int v) { byk[u]++;byk[v]++; if(byk[u]==N-1 || byk[v]==N-1){ join(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...