# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1139109 | THXuan | Monthly railway pass (LMIO18_menesinis_bilietas) | C++20 | 1 ms | 2112 KiB |
// subtask 1
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
typedef long long ll;
const ll INF = 1e9;
using namespace std;
int link[200005], sz[200005];
int find(int x) {
while (x != link[x]) x = link[x];
return x;
}
void unite(int a, int b) {
a = find(a);
b = find(b);
if (a == b) return;
if (a != b) {
if (sz[a] < sz[b]) swap(a, b);
sz[a] += sz[b];
link[b] = a;
}
}
void solve()
# | 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... |