# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
957627 | vjudge1 | Putovanje (COCI20_putovanje) | C++17 | 251 ms | 49884 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;
#ifdef DEBUG
#include "debug.h"
#else
#define debug(...) 0
#endif
#define int ll
#define pb push_back
#define ll long long
#define i2 array<int, 2>
#define SZ(x) (int) (x).size()
const int N = 2e5 + 4, LG = 20;
int n, h[N], pos[N], neg[N], cnt[N], anc[N][LG];
vector<int> adj[N];
map<i2, i2> cost;
void dfs(int v = 1, int p = 1) {
for (int i = 1; i < LG; i++) {
int u = anc[v][i - 1];
u = anc[u][i - 1];
if (u)
anc[v][i] = u;
}
for (int u : adj[v]) {
if (u != p) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |