Submission #779471

#TimeUsernameProblemLanguageResultExecution timeMemory
779471DaktoGame (IOI14_game)C++17
42 / 100
1087 ms12636 KiB
#include<bits/stdc++.h> using namespace std; int n; vector<set<int>> gr; void initialize(int N){ n=N; gr.resize(n); for(int i=0; i<n; i++){ for(int j=i+1; j<n; j++){ gr[i].insert(j); gr[j].insert(i); } } } int hasEdge(int u, int v){ vector<bool> seen(n,0); queue<int> q; q.push(u); seen[u]=1; while(!q.empty()){ auto t=q.front(); q.pop(); if(t==v){ gr[u].erase(v); gr[v].erase(u); return 0; } for(auto i:gr[t]){ if(t==u && i==v) continue; if(!seen[i]){ seen[i]=1; q.push(i); } } } return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...