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>
#include "game.h"
using namespace std;
const int MAXN = 1505;
int fth[MAXN];
int find(int u){
return u == fth[u] ? u : fth[u] = find(fth[u]);
}
void merge(int u, int v){
u = find(u);
v = find(v);
fth[v] = u;
}
void initialize(int n){
iota(fth, fth + MAXN, 0);
}
int hasEdge(int u, int v){
if(find(u) == find(v)){
return 0;
}
merge(u, v);
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... |