Submission #768728

#TimeUsernameProblemLanguageResultExecution timeMemory
768728zsomborGame (IOI14_game)C++17
42 / 100
1084 ms804 KiB
#include <iostream> #include <vector> #include "game.h" using namespace std; int n; vector <vector <bool>> e(1500, vector <bool>(1500, true)); vector <bool> volt(1500, false); void dfs(int x) { if (volt[x]) return; volt[x] = true; for (int i = 0; i < n; i++) if (e[x][i]) dfs(i); } void initialize(int N) { n = N; } int hasEdge(int u, int v) { e[u][v] = e[v][u] = false; fill(volt.begin(), volt.begin() + n, false); dfs(u); if (!volt[v]) e[u][v] = e[v][u] = true; return e[u][v]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...