This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#ifndef NOTSUBMIT
#include <bits/stdc++.h>
#include "game.h"
using namespace std;
#endif // NOTSUBMIT
// Subtask 1 2
int nc;
int adj[90][90];
int cnt = 0;
bool chk[90];
void dfs(int now){
chk[now] = 1; cnt += 1;
for (int nxt = 1; nxt <= nc; nxt++){
if (chk[nxt]){ continue; }
dfs(nxt);
}
}
void initialize(int n) {
nc = n;
for (int i = 1; i <= n; i++){
for (int j = 1; j <= n; j++){
adj[i][j] = 1;
}
}
}
int hasEdge(int u, int v) { u += 1; v += 1;
adj[u][v] = adj[v][u] = 0;
cnt = 0; memset(chk, 0, sizeof(chk));
dfs(u);
if (cnt != nc){ adj[u][v] = adj[v][u] = 1; return 1; }
else{ 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... |