Submission #66279

#TimeUsernameProblemLanguageResultExecution timeMemory
66279someone_aaGame (IOI14_game)C++17
0 / 100
3 ms776 KiB
#include <bits/stdc++.h> #include "game.h" using namespace std; const int maxn = 1600; int s[maxn][maxn], parent[maxn]; int n; void initialize(int N) { for(int i=0;i<N;i++) { parent[i] = i; for(int j=0;j<N;j++) s[i][j] = 1; s[i][i] = 0; } n = N; } void unite(int u, int v) { if(u > v) swap(u, v); for(int i=0;i<n;i++) { s[u][i] = s[i][u] = s[u][i] + s[v][i]; } } int hasEdge(int u, int v) { u = parent[u]; v = parent[v]; if(s[u][v] == 1) { unite(u, v); return 1; } else { s[u][v]--; s[v][u]--; return 0; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...