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"
using namespace std;
using ll = long long;
const int mxN = 2e3+10;
int cnt[mxN], n, past = 0;
int hasEdge(int u, int v) {
++cnt[u]; ++cnt[v];
if(cnt[u] == n-1 || cnt[v] == n-1) --past;
if(cnt[u] == n-1 || cnt[v] == n-1) return 1;
if((cnt[u] == n-2 || cnt[v] == n-2) && past) {
--past;
if(cnt[u] == n-2) cnt[u] = n;
else if(cnt[v] == n-2) cnt[v] = n;
return 1;
}
if(cnt[u] == n-2) past++;
if(cnt[v] == n-2) past++;
return 0;
}
void initialize(int N) {
n = N;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |