제출 #48350

#제출 시각아이디문제언어결과실행 시간메모리
48350jeong게임 (IOI14_game)C++17
100 / 100
473 ms16188 KiB
#include <stdio.h> #define N (1500) int p[N], e[N][N], nn; void initialize(int n){ nn=n; for(int i=0;i<n;i++){ p[i]=i; for(int j=0;j<n;j++)e[i][j]=i!=j; } } int find(int x){if(p[x] == x)return x;return p[x] = find(p[x]);} int hasEdge(int u, int v){ int a = find(u), b = find(v); if(e[a][b]==1){ p[b]=a; for(int i=0; i<nn; i++)e[a][i]=e[i][a]+=e[b][i]; return 1; } e[a][b]=--e[b][a]; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...