Submission #317787

#TimeUsernameProblemLanguageResultExecution timeMemory
317787miss_robotGame (IOI14_game)C++14
42 / 100
1028 ms12152 KiB
#include <bits/stdc++.h> #include "game.h" using namespace std; int n, c; vector< unordered_set<int> > g; vector<int> vis; void initialize(int N){ n = N; g.resize(n); for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) if(i != j) g[i].insert(j); } void dfs(int u){ if(vis[u]) return; vis[u] = 1, c++; for(int v : g[u]) dfs(v); } int hasEdge(int u, int v) { if(!g[u].count(v)) return 0; g[u].erase(v), g[v].erase(u); vis.assign(n, 0), c = 0; dfs(0); if(c < n) g[u].insert(v), g[v].insert(u); return c < n; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...