Submission #1016779

#TimeUsernameProblemLanguageResultExecution timeMemory
1016779n3rm1nGame (IOI14_game)C++17
0 / 100
1 ms2396 KiB
#include <bits/stdc++.h> #include "game.h" using namespace std; const int MAXN = 2e3 + 10; int vcnt; int par[MAXN]; int cnt[MAXN][MAXN]; vector < int > g[MAXN]; void initialize(int n) { vcnt = n; for (int i = 0; i < n; ++ i) par[i] = i; for (int i = 0; i < n; ++ i) { for (int j = 0; j < n; ++ j) if(i != j)cnt[i][j] = 1; } } int hasEdge(int u, int v) { u = par[u]; v = par[v]; if(u == v) { return 0; } if(cnt[u][v] == 1) { //cout << 1 << endl; for (int i = 0; i < vcnt; ++ i) { if(i == u)continue; if(i == v)continue; cnt[i][u] += cnt[i][v]; cnt[u][i] += cnt[v][i]; } par[v] = u; for (int i = 0; i < vcnt; ++ i) { cnt[i][v] = 0; cnt[v][i] = 0; } return 1; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...