# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
720701 | joelgun14 | Race (IOI11_race) | C++17 | 413 ms | 93016 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 "race.h"
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int l;
int res = 1e9;
const int lim = 2e5 + 5;
int depth[lim];
bool vis[lim];
vector<pair<int, int>> edges[lim];
struct disjoint_set {
int h[lim], sz[lim], d[lim];
ll shift[lim];
// fi -> distance
// se -> depth
// cari depth terkecil
set<pair<int, int>> a[lim];
disjoint_set() {
memset(h, -1, sizeof(h));
//memset(sz, 0, sizeof(sz));
fill(sz, sz + lim, 1);
memset(shift, 0, sizeof(shift));
memset(d, -1, sizeof(d));
}
int fh(int nd) {
return h[nd] == -1 ? nd : h[nd] = fh(h[nd]);
}
bool merge(int x, int y) {
x = fh(x), y = fh(y);
if(x != y) {
# | 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... |