# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
151422 | flashmt | Race (IOI11_race) | C++17 | 569 ms | 50540 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;
const int N = 200200, oo = 1 << 21;
int n, k, h[N][2], l[N], height[N], pos[N], deltaVal[N], st[N], last, curChild[N], par[N];
long long deltaID[N];
vector<pair<int, int>> a[N];
vector<int> order;
map<long long, int> m[N];
int ans = oo;
int unionMap(int u, int v, int c)
{
int res = oo;
long long offsetID = c + deltaID[u] + deltaID[v];
int offsetVal = 1 + deltaVal[u] + deltaVal[v];
for (auto it : m[v])
if (m[u].count(k - it.first - offsetID))
res = min(res, it.second + m[u][k - it.first - offsetID] + offsetVal);
offsetID = c + deltaID[v] - deltaID[u];
offsetVal = 1 + deltaVal[v] - deltaVal[u];
for (auto it : m[v])
if (!m[u].count(it.first + offsetID) || m[u][it.first + offsetID] > it.second + offsetVal)
m[u][it.first + offsetID] = it.second + offsetVal;
m[v].clear();
return res;
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... |