# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
298903 | Bruteforceman | Tax Evasion (LMIO19_mokesciai) | C++11 | 2051 ms | 40952 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;
const int maxn = 2e5 + 10;
const int logn = 19;
vector <int> g[maxn];
int par[maxn];
int dep[maxn];
int vis[maxn];
int anc[logn + 1][maxn];
int lift(int x, int depth) {
for(int i = logn; i >= 0; i--) {
if(dep[x] - (1 << i) > depth) {
x = anc[i][x];
}
}
return x;
}
void dfs(int x) {
for(int i : g[x]) {
dep[i] = 1 + dep[x];
dfs(i);
}
}
pair <int, int> getFarthest(int x) {
if(vis[x]) return make_pair(0, x);
pair <int, int> ans (dep[x], x);
for(int i : g[x]) {
ans = max(ans, getFarthest(i));
}
return ans;
# | 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... |