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<bits/stdc++.h>
#include "game.h"
#define MAXN 1501
using namespace std;
set<int> g[MAXN];
void initialize(int n) {
for(int i = 0; i < n; i++)
for(int j = 0; j < n;j++) {
if(i == j)continue;
g[i].insert(j);
}
}
int hasEdge(int u, int v)
{
bool ans =(g[u].size()==1||g[v].size()==1);
if(g[u].count(v))
g[u].erase(v);
if(g[v].count(u))
g[v].erase(u);
if(g[u].size() == 1)
{
int it =*g[u].begin();
if(g[it].count(u))
g[it].erase(u);
}
if(g[v].size() == 1)
{
int it = *g[v].begin();
if(g[it].count(v))
g[it].erase(v);
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |