Submission #393936

# Submission time Handle Problem Language Result Execution time Memory
393936 2021-04-25T01:21:02 Z KoD Duathlon (APIO18_duathlon) C++17
Compilation error
0 ms 0 KB
    const auto calc = RecLambda([&](auto&& dfs, const usize u) -> void {
        subtree[u] = (u < N);
        for (const auto v: bctree[u]) {
            dfs(v);
            subtree[u] += subtree[v];
            if (u >= N) {
                ans -= (u64) bctree[u].size() * subtree[v] * (subtree[v] - 1);
            }
        }
    });

Compilation message

count_triplets.cpp:1:34: error: non-local lambda expression cannot have a capture-default
    1 |     const auto calc = RecLambda([&](auto&& dfs, const usize u) -> void {
      |                                  ^
count_triplets.cpp:1:55: error: 'usize' does not name a type
    1 |     const auto calc = RecLambda([&](auto&& dfs, const usize u) -> void {
      |                                                       ^~~~~
count_triplets.cpp: In lambda function:
count_triplets.cpp:10:7: error: expected '{' before ';' token
   10 |     });
      |       ^
count_triplets.cpp: At global scope:
count_triplets.cpp:10:7: error: expected ')' before ';' token
   10 |     });
      |       ^
      |       )
count_triplets.cpp:1:32: note: to match this '('
    1 |     const auto calc = RecLambda([&](auto&& dfs, const usize u) -> void {
      |                                ^
count_triplets.cpp:1:16: warning: 'calc' defined but not used [-Wunused-variable]
    1 |     const auto calc = RecLambda([&](auto&& dfs, const usize u) -> void {
      |                ^~~~