Submission #209786

#TimeUsernameProblemLanguageResultExecution timeMemory
209786my99nGame (IOI14_game)C++14
0 / 100
5 ms376 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; int deg[2000], asked[2000][2000], ans[2000][2000]; void initialize(int n) { for (int i = 0; i < n; i++) deg[i] = n-1; } int hasEdge(int u, int v) { // assert that query are unique if (asked[u][v]) return ans[u][v]; deg[u]--; deg[v]--; if (!deg[u] and !deg[v]) return 0; if (deg[v] == 0) swap(u, v); if (deg[u] == 0) return asked[u][v] = asked[v][u] = ans[u][v] = ans[v][u] = 1; asked[u][v] = asked[v][u] = 1; return ans[u][v] = ans[v][u] = 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...