#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 |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
444 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |