Submission #48311

#TimeUsernameProblemLanguageResultExecution timeMemory
48311jeongGame (IOI14_game)C++17
0 / 100
2 ms572 KiB
#include <stdio.h> #define N (1500) int deg[N], par[N]; void initialize(int n){for(int i=0; i<n; i++)par[i]=i,deg[i]=n-1;} int find(int x){ if(par[x] == x)return x; return par[x] = find(par[x]); } int hasEdge(int u, int v){ u = find(u), v = find(v); deg[u]--;deg[v]--; if(u == v)return 0; else{ if(deg[u] == 0 || deg[v] == 0){ deg[u] += deg[v]; deg[v] = 0;par[v] = u; return 1; } return 0; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...