# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
839490 | serifefedartar | Putovanje (COCI20_putovanje) | C++17 | 104 ms | 25676 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;
#define debug(x) {cout << #x << ": "; for (auto it : x) cout << it << " ";cout << endl;}
#define fast ios::sync_with_stdio(0);cin.tie(0);
typedef long long ll;
#define f first
#define s second
#define MOD 998244353
#define LOGN 20
#define MAXN 200005
vector<vector<pair<int,pair<ll,ll>>>> graph;
vector<ll> cnt;
int up[LOGN][MAXN], depth[MAXN];
void dfs(int node, int parent) {
for (auto u : graph[node]) {
if (u.f == parent)
continue;
depth[u.f] = depth[node] + 1;
up[0][u.f] = node;
for (int i = 1; i < LOGN; i++)
up[i][u.f] = up[i-1][up[i-1][u.f]];
dfs(u.f, node);
}
}
int find(int node, int k) {
for (int i = 0; i < LOGN; i++) {
if ((1<<i) & k)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |