Submission #23689

#TimeUsernameProblemLanguageResultExecution timeMemory
23689HiasatGame (IOI14_game)C++14
0 / 100
0 ms10824 KiB
#include "game.h" #include <iostream> #include <cstdio> #include <set> #include <vector> using namespace std; int dsu[2010]; int rem[2010]; int find(int u){ return dsu[u] == u ? u : dsu[u] = find(dsu[u]); } void initialize(int n) { for (int i = 0; i < n; ++i){ dsu[i] = i; rem[i] = n-1; } } int hasEdge(int u, int v) { int a = find(u); int b = find(v); rem[a]--; rem[b]--; if(rem[a] == 0 || rem[b] == 0){ rem[b] += rem[a]; dsu[a] = b; return 1; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...