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 N = 80;
int n, adj[N][N];
bool vst[N];
void Dfs(int u){
if (vst[u])
return;
vst[u] = 1;
for(int v = 0; v < n; v++)
if (adj[u][v])
Dfs(v);
}
void initialize(int _n){
n = _n;
for(int u = 0; u < n; u++)
for(int v = 0; v < n; v++)
adj[u][v] = 1;
}
int hasEdge(int u, int v){
for(int i = 0; i < n; i++)
vst[i] = 0;
adj[u][v] = adj[v][u] = 0;
Dfs(u);
if (!vst[v])
adj[u][v] = adj[v][u] = 1;
return adj[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... |