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>
int km[1520];
int rel[1520][1520];
int gln;
void initialize(int n)
{
gln=n;
for(int i=0;i<n;i++) km[i]=i;
for(int i=0;i<n;i++) for(int j=0;j<n;j++) if(i!=j) rel[i][j]=1;
}
int hasEdge(int u, int v)
{
if(rel[km[u]][km[v]]>1)
{
rel[km[u]][km[v]]--;
rel[km[v]][km[u]]--;
return 0;
}
int x=km[u];
for(int i=0;i<gln;i++) if(km[i]==x) km[i]=km[v];
for(int i=0;i<1500;i++) rel[i][km[v]]=rel[km[v]][i]=rel[km[v]][i]+rel[x][i];
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... |