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;
typedef long long ll;
int cnt, a[1501], n, key;
bool b;
void initialize(int q) {
n=q;
}
int hasEdge(int u, int v) {
cnt+=!a[u]+!a[v];
int ans=0;
if(!b && cnt==n) {
b=1;
ans=0;
if(!a[u]) key=u;
else key=v;
}
else if(cnt<n) ans=1;
else {
if(u==key || v==key) ans=0;
else ans=1;
}
a[u]=a[v]=1;
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... |