# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
382238 | pure_mem | Hard route (IZhO17_road) | C++14 | 10 ms | 12160 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 <iostream>
#include <vector>
#define X first
#define Y second
#define MP make_pair
#define ll long long
using namespace std;
const int N = 5e5 + 12;
const int INF = 2e9;
int n, m;
ll ans, mx_ans;
pair<int, int> dp[N];
vector< int > g[N];
void dfs(int v, int pr){
for(int to: g[v]){
if(to != pr){
dfs(to, v);
if(dp[v].X < dp[to].X + 1){
dp[v] = dp[to], dp[v].X++;
}
else if(dp[v].X == dp[to].X + 1){
dp[v].Y += dp[to].Y;
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |