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"
const int MN = 1501;
int N;
int mat[MN][MN];
int ct[MN];
void initialize(int n) {
N = n;
for (int i=0; i<N; ++i) {
for (int j=0; j<N; ++j) {
mat[i][j] = -1;
}
ct[i] = 0;
mat[i][i] = 1;
}
}
int hasEdge(int u, int v) {
if (mat[u][v] != -1) return mat[u][v];
++ct[u];
++ct[v];
mat[u][v] = ct[u] == N-1 || ct[v] == N-1;
return mat[u][v];
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |