# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
757746 | taher | Race (IOI11_race) | C++17 | 402 ms | 44040 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 inf = (int) 1e9;
const int N = (int) 2e5 + 1;
const int M = (int) 1e6 + 1;
vector<pair<int, int>> adj[N];
vector<pair<int, int>> tmp;
int Get_Min[M], idx[M];
int sz[N];
bool vis[N];
int ans = inf;
int k;
int Dfs2(int node, int pre, int depth, int tot, int id) {
if (tot > k) return inf;
int res = inf;
if (idx[k - tot] == id) {
res = min(res, Get_Min[k - tot] + depth);
}
tmp.emplace_back(tot, depth);
for (auto [x, y] : adj[node]) {
if (x == pre || vis[x]) {
continue;
}
res = min(res, Dfs2(x, node, depth + 1, tot + y, id));
}
return res;
# | 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... |