Submission #349050

#TimeUsernameProblemLanguageResultExecution timeMemory
349050NachoLibreGame (IOI14_game)C++14
0 / 100
1 ms364 KiB
#include <bits/stdc++.h> using namespace std; #ifndef wambule #include "game.h" #endif const int N = 1503; int opw[N], r[N][N], globn; int P(int x) { return (opw[x] ? opw[x] = P(opw[x]) : x); } void initialize(int n) { // hello wambule globn = n; for(int i = 0; i < n; ++i) { opw[i] = 0; for(int j = 0; j < n; ++j) r[i][j] = 1; } } int hasEdge(int x, int y) { int n = globn; x = P(x); y = P(y); if(x == y) return 0; if(r[x][y] ^ 1) { --r[x][y]; --r[y][x]; return 0; } for(int i = 0; i < n; ++i) { r[x][i] += r[y][i]; r[i][x] += r[i][y]; } opw[y] = x; return 1; } #ifdef wambule int main() { ios::sync_with_stdio(0); cin.tie(0); return 0; } #endif
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...