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;
const int N = 1502;
vector<int> cnt(N, 1);
vector<bool> mark(N, false);
int actn;
int r;
int cont = 0;
void initialize(int n) {
actn = n;
r = ((n-1)*n)/2;
}
int hasEdge(int u, int v) {
if(cont == r/2) return 1;
if((cnt[u] == actn-1) || (cnt[v] == actn-1)){
mark[u] = true;
mark[v] = true;
cnt[u]++;
cnt[v]++;
return 1;
} else {
cont++;
cnt[u]++;
cnt[v]++;
return 0;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |