# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
433855 | medmdg | Game (IOI14_game) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "game.h"
#include<bits/stdc++.h>
using namespace std;
vector<ll> c;
vector<bool> vis;
ll h=0;
void initialize(int n) {
for(int i=0;i<n;i++){
c.push_back(0);
vis.push_back(false);
}
}
int hasEdge(int u, int v) {
h++;
if(h==n) return 1;
u--;
v--;
c[u]++;
c[v]++;
if((c[u]==n&&!vis[u])||c[v]==n&&!vis[v]){
vis[u]=true;
vis[v]=true;
return 1;
}
return 0;
}