# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
305155 | Temmie | Stations (IOI20_stations) | C++17 | 1194 ms | 1056 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>
struct Node {
std::vector <int> nei;
int d, a, b;
Node() : d(0), a(0), b(0) { }
};
struct Triplet {
int x, y, z;
Triplet(int X = 0, int Y = 0, int Z = 0) : x(X), y(Y), z(Z) { }
bool operator<(const Triplet& other) const {
if (x == other.x) return y > other.y;
return x < other.x;
}
};
int cnt;
void dfs(std::vector <Node>& g, int node = 0, int par = -1) {
g[node].a = cnt++;
g[node].d = par == -1 ? 0 : g[par].d + 1;
for (int x : g[node].nei) if (x != par) dfs(g, x, node);
g[node].b = cnt - 1;
}
std::vector <int> label(int n, int k, std::vector <int> u, std::vector <int> v) {
cnt = 0;
std::vector <int> r(n);
std::vector <Node> g(n);
# | 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... |