Submission #70068

#TimeUsernameProblemLanguageResultExecution timeMemory
70068yusufakeGame (IOI14_game)C++98
100 / 100
735 ms40588 KiB
#include<bits/stdc++.h> using namespace std; #include "game.h" #define N 1502 int T[N][N],ata[N],sz[N],n; int find(int x){ return ata[x] == x ? x : ata[x] = find(ata[x]); } int hasEdge(int x, int y){ if((x=find(x)) == (y=find(y))) assert(0); if(T[x][y] < sz[x]*sz[y]-1){ T[x][y]++; T[y][x]++; return 0; } ata[y] = x; sz[x] += sz[y]; for(int i=0;i<n;i++){ T[x][i] += T[y][i]; T[i][x] += T[y][i]; } return 1; } void initialize(int ss){ n = ss; for(int i=0; i<n; i++){ ata[i] = i; sz[i] = 1; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...