Submission #628003

#TimeUsernameProblemLanguageResultExecution timeMemory
628003SebGame (IOI14_game)C++17
0 / 100
1 ms212 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; ll p[1505],sz[1505]; ll lider(ll a) { if (p[a]==a) return a; p[a] = lider(p[a]); return p[a]; } void unir(ll a, ll b) { if (sz[b]>sz[a]) swap(a,b); p[b] = a; sz[a] += sz[b]; return; } void initialize(int n) { ll i; for (i=0;i<n;i++) { p[i] = i; sz[i] = 1; } return; } int hasEdge(int u, int v) { if (lider(u)==lider(v)) return 0; else { unir(u,v); return 1; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...