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;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef pair<int,int> pi;
typedef vector<pi> pii;
typedef tuple<int,int,int> tii;
typedef vector<ll> li;
typedef vector<li> lii;
#define REP(i,a,b) for(int i=a;i<b;i++)
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define LSOne(s) ((s)&(-s))
ll INF=1e18+10;
int inf=1e9+10;
ll M=1e9+7;
int n;
vector<set<int>> a;
vi vis;
void dfs(int x){
vis[x]=1;
for(auto u:a[x]){
if(vis[u])continue;
dfs(u);
}
}
void initialize(int N) {
n=N;
a.resize(n);
REP(i,0,n)REP(j,0,n)if(i!=j)a[i].insert(j);
}
int hasEdge(int u, int v) {
vis.clear();vis.resize(n,0);
a[u].erase(v);a[v].erase(u);
dfs(0);
REP(i,0,n)if(vis[i]==0){
a[u].insert(v);a[v].insert(u);
return 1;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |