Submission #270697

#TimeUsernameProblemLanguageResultExecution timeMemory
270697daniel920712Game (IOI14_game)C++14
100 / 100
614 ms25336 KiB
#include "game.h" #include <vector> using namespace std; int con=0,a,b,ok=0; int Father[1505]; int sz[1505]; int how[1505][1505]={0},N; vector < pair < int , int > > all; int Find(int here) { if(Father[here]==here) return here; Father[here]=Find(Father[here]); return Father[here]; } void initialize(int n) { int i; N=n; for(i=0;i<n;i++) { Father[i]=i; sz[i]=1; } return ; } int hasEdge(int u, int v) { int con=0,i; if(Find(u)==Find(v)) return 0; if(how[Find(u)][Find(v)]==sz[Find(u)]*sz[Find(v)]-1) { how[Find(u)][Find(v)]++; how[Find(v)][Find(u)]++; for(i=0;i<N;i++) { how[Find(u)][i]+=how[Find(v)][i]; how[i][Find(u)]=how[Find(u)][i]; } sz[Find(u)]+=sz[Find(v)]; Father[Find(v)]=Find(u); return 1; } else { how[Find(u)][Find(v)]++; how[Find(v)][Find(u)]++; } return 0; }

Compilation message (stderr)

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:29:9: warning: unused variable 'con' [-Wunused-variable]
   29 |     int con=0,i;
      |         ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...