Submission #426733

#TimeUsernameProblemLanguageResultExecution timeMemory
426733DaktoGame (IOI14_game)C++17
42 / 100
1084 ms13408 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; vector<set<int>> g; int n; 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); } int hasEdge(int u, int v) { g[u].erase(g[u].find(v)); g[v].erase(g[v].find(u)); queue<int> q; q.emplace(u); vector<bool> s(n,0); while(!q.empty()){ int t=q.front(); q.pop(); if(s[t]) continue; s[t]=1; if(t==v) return 0; for(auto i: g[t]) if(!s[i]) q.emplace(i); } g[u].emplace(v); g[v].emplace(u); return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...