# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
216715 | DS007 | 게임 (IOI14_game) | C++14 | 6 ms | 512 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
class DSU {
int *par, *val;
int n, count;
public:
DSU(int n) {
this->n = n;
count = 0;
par = new int[n];
val = new int[n];
iota(par, par + n, 0);
fill(val, val + n, n - 1);
}
int find(int v) {
if (v == par[v])
return v;
else
return par[v] = find(par[v]);
}
int merge(int a, int b) {
int pa = find(a), pb = find(b);
if (pa == pb)
return 0;
par[pa] = pb;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |