# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
635882 | phathnv | Through Another Maze Darkly (CCO21_day1problem3) | C++11 | 1322 ms | 319336 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 = 2e6 + 10;
int n, q, timer;
vector<int> adj[N];
vector<array<int, 2>> phase[N];
void dfs(int u, int p, int t) {
phase[t].push_back({++timer, u});
bool mark = false;
for (int v : adj[u]) {
if (v == p) {
mark = true;
continue;
}
if (mark) {
dfs(v, u, t + 1);
phase[t + 1].push_back({++timer, u});
}
}
for (int v : adj[u]) {
if (v == p) {
break;
}
dfs(v, u, t);
phase[t].push_back({++timer, u});
}
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... |