제출 #18693

#제출 시각아이디문제언어결과실행 시간메모리
18693mindol게임 (IOI14_game)C++14
0 / 100
0 ms18668 KiB
int e[1500][1500]; int degree[1500]; int n; void initialize(int N) { n=N; for(int i=0;i<n;i++) degree[i]=n-1; for(int i=0;i<n;i++) for(int j=0;j<n;j++) e[i][j]=-1; } int hasEdge(int u,int v) { if(~e[u][v]) return e[u][v]; e[u][v]=e[v][u]=0; degree[u]--, degree[v]--; while(degree[u]==1) { for(int i=0;i<n;i++) if(i!=u && e[u][i]==-1) { e[u][i]=e[i][u]=1; degree[i]--; u=i; break; } degree[u]=0; } while(degree[v]==1) { for(int i=0;i<n;i++) if(i!=v && e[v][i]==-1) { e[v][i]=e[i][v]=1; degree[i]--; v=i; break; } degree[v]=0; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...