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"
const int maxn = 1505;
int deg[maxn];
int n;
int tot;
void initialize(int _n)
{
n = _n;
tot = n*(n-1)/2;
}
int hasEdge(int u, int v)
{
deg[u]++; deg[v]++;
bool res = false;
if(deg[u] == n-1 || deg[v] == n-1) res = true;
if(res && tot == n-1) res = false;
if(res) tot--;
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |