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 <bits/stdc++.h>
#define lp(i,a,b) for(int i=a;i<b;i++)
#define ll long long
const int maxn=1505 ;
using namespace std;
int n,tam;
int s[maxn] ;
bool marc[maxn][maxn];
bool comp[maxn] ;
int hasEdge(int u,int v)
{
marc[u][v]=marc[v][u]=true ;
if(!comp[u]&& !comp[v])return 0 ;
if(comp[v])swap(u,v) ;
if(s[v]!=tam-1) {s[v]++ ; return 0 ;}
comp[v]=true ;
tam++;
lp(i,0,n)
if(marc[i][v]) s[i]++;
return 1 ;
}
void initialize(int N)
{
n=N;
comp[0]=true;
tam=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... |