Submission #393936

#TimeUsernameProblemLanguageResultExecution timeMemory
393936KoDDuathlon (APIO18_duathlon)C++17
Compilation error
0 ms0 KiB
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 (stderr)

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 {
      |                ^~~~