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 <iostream>
#include <vector>
#include <set>
#include "game.h"
using namespace std;
const int N = 85;
vector<int> nei[N],nei2[N];
int block[N][N];
bool seen[N];
int n;
set<pair<int,int>> e;
void initialize(int N){
n = N;
for (int i=0;i<n;i++)
for (int j=i+1;j<n;j++){
e.insert({i,j});
nei[i].push_back(j);
nei[j].push_back(i);
block[i][j] = block[j][i] = true;
}
return;
}
void clear(){
for (int i=0;i<=n;i++)
seen[i] = false;
}
int dfs(int u){
seen[u] = true;
int a = 1;
for (int i : nei[u])
if (!seen[i] and !block[u][i])
a += dfs(i);
return a;
}
int hasEdge(int u,int v){
clear();
block[u][v] = block[v][u] = false;
if (dfs(u)==n){
block[u][v] = block[v][u] = true;
return 0;
}
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... |