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 mxN=80;
int n;
bool adj[mxN][mxN], vis[mxN];
void initialize(int n) {
::n=n;
for(int i=0; i<n; ++i)
for(int j=0; j<n; ++j)
adj[i][j]=1;
}
int dfs(int u) {
int s=1;
vis[u]=1;
for(int v=0; v<n; ++v)
if(adj[u][v]&&!vis[v])
s+=dfs(v);
return s;
}
int hasEdge(int u, int v) {
adj[u][v]=adj[v][u]=0;
memset(vis, 0, n);
adj[u][v]=adj[v][u]=dfs(0)<n;
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... |