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 = 1500;
int n;
bitset<N> adj[N], edge[N];
void initialize(int nn) {
n = nn;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (i == j) continue;
adj[i][j] = 1;
}
}
}
int hasEdge(int u, int v) {
if (edge[u][v]) return 1;
adj[u][v] = adj[v][u] = 0;
if (adj[u].count() == 1) {
int x = 0;
while (!adj[u][x]) x++;
adj[u][x] = adj[x][u] = 0;
edge[u][x] = edge[x][u] = 1;
}
if (adj[v].count() == 1) {
int x = 0;
while (!adj[v][x]) x++;
adj[v][x] = adj[x][v] = 0;
edge[v][x] = edge[x][v] = 1;
}
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... |