# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
442061 | Dormi | 열쇠 (IOI21_keys) | C++17 | 1868 ms | 173612 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
#include "keys.h"
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
template<typename T>
int sz(const T &a){return int(a.size());}
const int MN=3e5+1;
struct dsu {
pii t[MN];
void reset(int n) {
for (int i = 0; i <= n; i++)t[i] = {i, 1};
}
int find(int a) {
if (t[a].first == a)return a;
return t[a].first = find(t[a].first);
}
bool uni(int a, int b) {
int ap = find(a), bp = find(b);
if (ap == bp)return false;
if (t[ap].second < t[bp].second)swap(ap, bp);
t[bp].first = ap;
t[ap].second += t[bp].second;
return true;
}
}cn,cc;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |