Problem treecutting
User Lucianzz
Submission Time 2026-02-18 14:45:41
Score 0
Max Time N/A
Max Memory N/A

Compile Error

treecutting.cpp:5:9: error: expected unqualified-id before ‘for’
5 | for (auto& entry : top_paths) {
| ^~~
treecutting.cpp:11:9: error: ‘dp_up’ does not name a type
11 | dp_up[v] = best_path_rest + 1;
| ^~~~~
treecutting.cpp:23:9: error: expected unqualified-id before ‘for’
23 | for (auto& entry : top_diams) {
| ^~~
treecutting.cpp:33:9: error: expected unqualified-id before ‘for’
33 | for (auto& entry : top_paths) {
| ^~~
treecutting.cpp:41:9: error: ‘best_diam_rest’ does not name a type
41 | best_diam_rest = max(best_diam_rest, path1 + path2);
| ^~~~~~~~~~~~~~
treecutting.cpp:43:9: error: ‘diam_up’ does not name a type
43 | diam_up[v] = best_diam_rest;
| ^~~~~~~
treecutting.cpp:49:18: error: ‘diam_down’ was not declared in this scope
49 | int d1 = diam_down[v];