# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
170306 | nvmdava | Hard route (IZhO17_road) | C++17 | 1036 ms | 64888 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 ll long long
#define ff first
#define ss second
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define INF 0x3f3f3f3f
#define MOD 1000000007
#define N 500005
int dep[N], par[N];
bool bl[N];
vector<int> adj[N];
int dfs1(int v, int p){
par[v] = p;
dep[v] = dep[p] + 1;
int res = v;
for(int& x : adj[v]){
if(p == x) continue;
int w = dfs1(x, v);
if(dep[w] > dep[res])
res = w;
}
return res;
}
ll ans = 0, cnt = 1;
int d[N];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |