#include "game.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define str string
#define vd void
#define vb vector<bool>
#define F first
#define S second
#define lbr '\n'
#define all(x) x.begin(), x.end()
const ll INF = 1E15;
const ll mod = 1000000007;
vector<vll> g;
vb v;
ll n;
ll dfs(ll a) {
if (v[a]) return 0;
v[a] = 1;
ll r = 1;
for (int i=0; i<n; i++) {
if (g[a][i]) r += dfs(i);
}
return r;
}
void initialize(int N) {
n = N;
g.assign(n, vll(n, 1));
for (int i=0; i<n; i++) g[i][i]=0;
}
int hasEdge(int x, int y) {
v.assign(n, 0);
g[x][y] = 0;
g[y][x] = 0;
ll d = dfs(1);
cout<<d<<lbr;
if (d == n) return 0;
else {
g[x][y] = 1;
g[y][x] = 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... |