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;
int par[1505];
int find(int x){
if(par[x]==x)return x;
return par[x]=find(par[x]);
}
void join(int a,int b){
par[find(a)]=find(b);
}
void initialize(int n) {
for(int i=0;i<n;i++)par[i]=i;
}
int hasEdge(int u, int v) {
if(find(u)!=find(v)){
join(u,v);
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... |