Submission #18698

#TimeUsernameProblemLanguageResultExecution timeMemory
18698mindolGame (IOI14_game)C++14
15 / 100
3 ms19128 KiB
#include<set> int n; std::set<int> s[1500]; int e[1500][1500]; void initialize(int N) { n=N; for(int i=0;i<N;i++) for(int j=0;j<N;j++) if(i!=j) s[i].insert(j); } int hasEdge(int a,int b) { if(s[a].find(b)==s[a].end()) return e[a][b]; s[a].erase(b); s[b].erase(a); while(s[a].size()==1) { int next=*s[a].begin(); e[a][next]=e[next][a]=1; s[a].erase(next); s[next].erase(a); a=next; } while(s[b].size()==1) { int next=*s[b].begin(); e[b][next]=e[next][b]=1; s[b].erase(next); s[next].erase(b); b=next; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...