# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
290654 | apostoldaniel854 | Hard route (IZhO17_road) | C++14 | 9 ms | 12192 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;
using ll = long long;
#define pb push_back
#define dbg(x) cerr << #x << " " << x << "\n"
const int N = 5e5;
struct Best {
ll mx;
ll freq;
};
vector <int> gr[1 + N];
int n;
Best dpDown[1 + N], dpUp[1 + N];
void updateBest (Best &ans, Best cur) {
if (cur.freq == 0) return;
if (ans.mx < cur.mx) {
ans = cur;
}
else if (ans.mx == cur.mx)
ans.freq += cur.freq;
}
void dfsDown (int node, int par) {
dpDown[node] = {0, 1};
for (int son : gr[node])
if (son != par) {
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... |