Submission #1108143

#TimeUsernameProblemLanguageResultExecution timeMemory
1108143MingyuanzGame (IOI14_game)C++14
0 / 100
1 ms336 KiB
int N,par[1551]; void initialize(int n){ N=n; for(int i=0; i<n; i++) par[i]=i; } int root(int u){ return par[u]=(u==par[u])?u:root(par[u]); } int join(int u,int v){ int a=root(u),b=root(v); if(a!=b){ par[a]=b; N--; } return a!=b; } int hasEdge(int u,int v){ if(N==2) return 0; return join(u,v); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...