# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
464482 | lordlorinc | Railway (BOI17_railway) | C++17 | 226 ms | 22464 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;
int n, m, k, curTime = 0, leftTime = 0;
vector<vector<pair<int, int> > > graph;
vector<int> reach, segmentTree, order, reachToPos, firstReach, leftReach, nodeValues, solution;
void dfs(int pos, int curParent){
reach[pos] = curTime++;
reachToPos[reach[pos]] = pos;
order.push_back(reach[pos]);
firstReach[pos] = order.size() - 1;
for (pair<int, int> x : graph[pos]){
if (x.first == curParent) continue;
dfs(x.first, pos);
order.push_back(reach[pos]);
}
leftReach[pos] = leftTime++;
}
void buildSegmentTree(int pos, int l, int r){
if (l == r) {
segmentTree[pos] = order[l];
return;
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |