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;
const int MX = 1505;
int N;
int cnt[MX], a[MX][MX];
void initialize(int _N) {
N = _N;
for(int i = 0; i < N; i++) cnt[i] = N - i - 1, a[i][i] = 1;
}
int hasEdge(int u, int v) {
if(u > v) swap(u, v);
if(a[u][v] > 0) return a[u][v] - 1;
if(cnt[u] == 1) a[u][v] = 2;
else a[u][v] = 1;
cnt[u]--;
return a[u][v] - 1;
}
// int main() {
// int N;
// cin >> N;
// initialize(N);
// for(int i = 0; i < N * (N - 1) / 2; i++) {
// int u, v;
// cin >> u >> v;
// cout << hasEdge(u, v) << '\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... |