# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
762079 | gun_gan | Race (IOI11_race) | C++17 | 304 ms | 67424 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MX = 2e5 + 5;
vector<pair<ll, ll>> g[MX];
int par[MX];
set<pair<ll, ll>> st[MX]; // (total length, num of edge)
ll sum[MX], dep[MX];
int find(int v) {
return par[v] == v ? v : par[v] = find(par[v]);
}
ll N, K;
ll res = 1e9;
void merge(int u, int v) {
int tu = u, tv = v;
u = find(u), v = find(v);
if(st[u].size() > st[v].size()) {
swap(u, v);
}
par[u] = v;
for(auto [len, e] : st[u]) {
Compilation message (stderr)
# | 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... |