Submission #249709

#TimeUsernameProblemLanguageResultExecution timeMemory
249709muhammad_hokimiyonGame (IOI14_game)C++14
0 / 100
0 ms384 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; const int N = 2000; int n1; int cnt; int r = 0; int a[N]; int p[N]; int get( int x ) { return (p[x] == x ? x : p[x] = get(p[x])); } void initialize(int n) { n1 = n; cnt = n; for( int i = 1; i <= n; i++ )p[i] = i; } int hasEdge(int u, int v) { u += 1 , v += 1; r += 1; if( r == n1 * (n1 - 1) / 2 )return 1; int x = get(u); int y = get(v); if( x == y )return 1; if( cnt == 2 )return 0; cnt -= 1; return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...