# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
487669 | KazamaHoang | Putovanje (COCI20_putovanje) | C++14 | 136 ms | 24212 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;
struct Edge {
int u, v, cost_one, cost_two;
int get_other(int x) const {
return u ^ v ^ x;
}
};
int n;
vector<int> adj[200005];
Edge edges[200005];
int par[200005][20], h[200005], add[200005];
long long res = 0;
void dfs(int u, int prevEdge) {
for (int& id : adj[u])
if (prevEdge != id) {
int v = edges[id].get_other(u);
h[v] = h[u] + 1;
par[v][0] = u;
for (int i = 1; (1 << i) <= n; ++ i)
par[v][i] = par[par[v][i-1]][i-1];
dfs(v, id);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |