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"
int N,ar[1500][1500],vs[1500],c=0;
void initialize(int n) {
N=n;
for(int i=0;i<n;i++)
for(int j=0;j<n;j++)
if(i!=j)ar[i][j]=1;
}
bool dfs(int u,int v){
if(u==v)return 1;
vs[u]=c;
for(int i=0;i<N;i++)
if(ar[u][i]&&vs[i]!=c)
if(dfs(i,v))return 1;
return 0;
}
int hasEdge(int u,int v){
c++;
ar[u][v]=ar[v][u]=0;
if(dfs(u,v))return 0;
ar[u][v]=ar[v][u]=1;
return 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |