# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
957605 | vjudge1 | Putovanje (COCI20_putovanje) | C++17 | 91 ms | 37456 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>
#define file_io freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define fast_io ios::sync_with_stdio(false);cin.tie(0);
#define what(x) cerr << #x << " is " << x << '\n';
#define kill(x) {cout << x << '\n'; return;}
#define all(x) (x).begin(), (x).end()
#define pii pair<int, int>
#define pb push_back
#define ll long long
#define F first
#define S second
const ll inf = 1e16, mod = 1e9 + 7, delta = 1e9 + 9, SQ = 350, P = 6065621;
using namespace std;
const int N = 2e5 + 10, LG = 21;
int c1[N], c2[N], par[N][LG], yalp[N], h[N], cnt[N], a[N];
vector<pii> adj[N];
void dfs (int v, int p = -1) {
par[v][0] = p;
if (v == 1) yalp[v] = -1;
if (p + 1) h[v] = h[p] + 1;
for (int i = 1; i < LG; i++)
if (par[v][i - 1] + 1)
par[v][i] = par[par[v][i - 1]][i - 1];
for (auto [u, _]: adj[v])
if (u - p) dfs(u, v), yalp[u] = _;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |