# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1139139 | THXuan | Monthly railway pass (LMIO18_menesinis_bilietas) | C++20 | 280 ms | 68236 KiB |
#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[500005], sz[500005];
set<int>adj[500005];
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... |