# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
445230 | erke | Dango Maker (JOI18_dango_maker) | C++11 | 1 ms | 332 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int N = 3005;
int n, m;
char a[N][N];
struct Dsu {
int n; vector<int> root, cntc;
Dsu(int n): n(n), root(n + 1), cntc(n + 1) {
for (int i = 1; i <= n; i++) {
root[i] = i;
cntc[i] = 1;
}
}
int find(int i) {
if (i == root[i]) return i;
return root[i] = find(root[i]);
}
bool unite(int u, int v) {
u = find(u); v = find(v);
if (u == v) return false;
if (cntc[u] == cntc[v]) cntc[u]++;
if (cntc[u] < cntc[v]) swap(u, v);
root[v] = u;
return true;
}
};
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |