# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
462613 | JovanB | Railway (BOI17_railway) | C++17 | 155 ms | 26928 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;
typedef long double ld;
const int MAXLOG = 18;
int par[100005][MAXLOG+1];
vector <pair <int, int>> graf[100005];
int depth[100005];
int in[100005];
int out[100005];
int x[100005];
int pre[100005];
vector <int> res;
int tajm;
void dfs_pre(int v, int parent){
depth[v] = depth[parent] + 1;
par[v][0] = parent;
for(int j=1; j<MAXLOG; j++){
par[v][j] = par[par[v][j-1]][j-1];
}
in[v] = ++tajm;
for(auto d : graf[v]){
int c = d.first;
if(c != parent) dfs_pre(c, v);
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... |