# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
370894 | Fysty | Game (IOI14_game) | C++17 | 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 <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define F first
#define S second
#define pb push_back
int N,d[1505],cnt=0;
void initializer(int n)
{
N=n;
}
int hasEdge(int u,int v)
{
if(d[u]==n-1||d[v]==n-1)
{
d[u]++,d[v]++;
return 1;
}
else if(cnt==n*(n-1)/2-(n-1))
{
d[u]++,d[v]++;
return 1;
}
else
{
cnt++;
return 0;
}
}