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>
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
ll N,i,j,b[1551][1551],be[1551],tt;
void initialize(int n) {
N=n;
for(i=0;i<N;i++)
for(j=0;j<N;j++)
b[i][j]=1;
}
void rmt(ll aa)
{
be[aa]=tt;
ll ii;
for(ii=0;ii<N;ii++)
if(b[min(ii,aa)][max(ii,aa)]==1&&be[ii]!=tt)
rmt(ii);
}
int hasEdge(int u, int v) {
if(u>v)
swap(u,v);
b[u][v]=0;
memset(be,0,sizeof(be));
tt++;
rmt(u);
if(be[v]!=tt)
{
//cout<<"ds";
b[u][v]=1;
return 1;
}
else
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... |