이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |