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 nax = 80;
int g[nax][nax];
int n;
bool vis[nax];
int dfs(int v) {
int ret = 1;
vis[v] = 1;
for(int u=0; u<n; ++u) if(!vis[u] && g[v][u]!=0) {
ret += dfs(u);
}
return ret;
}
void initialize(int N) {
n = N;
for(int i=0; i<n; ++i) {
for(int j=0; j<n; ++j) if(i!=j) {
g[i][j] = 2;
}
}
}
int hasEdge(int u, int v) {
if(u==v) return 0;
if(g[u][v]!=2) return g[u][v];
g[u][v] = g[v][u] = 0;
memset(vis, 0, sizeof vis);
return g[u][v] = g[v][u] = (dfs(0)!=n);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |