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>
// Subtask 1 n = 4
using namespace std;
const int N = 1505;
int cont[N];
int neg = 0;
int n, r;
void initialize(int nn) {
memset(cont, 0, sizeof cont);
neg = 0;
n = nn;
r = n * (n - 1) / 2;
return;
}
int hasEdge(int u, int v) {
if(cont[u] == n-2 or cont[v] == n-2){
// must be positive
return 1;
}
if(neg == r - n + 1){
// must be positive
return 1;
}
cont[u]++;
cont[v]++;
neg++;
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... |