race.cpp: In function 'void dfsAns(int, int, int, int)':
race.cpp:37:43: error: 'restante' was not declared in this scope
37 | ans = min(ans, (ll)edges + melhor[restante]);
| ^~~~~~~~
race.cpp:41:33: error: invalid types 'bool[std::tuple_element<0, std::pair<int, int> >::type {aka int}]' for array subscript
41 | if(v != parent && !roots[v]){
| ^
race.cpp: In function 'void dfsMelhor(int, int, int, int)':
race.cpp:48:8: error: 'dist' was not declared in this scope
48 | if(dist > k) return;
| ^~~~
race.cpp:52:14: error: 'dist' was not declared in this scope
52 | flag[dist] = flagAtual;
| ^~~~
race.cpp:56:33: error: invalid types 'bool[std::tuple_element<0, std::pair<int, int> >::type {aka int}]' for array subscript
56 | if(v != parent && !roots[v]){
| ^
race.cpp: In function 'int subTree(int, int)':
race.cpp:66:34: error: invalid types 'bool[std::tuple_element<0, std::pair<int, int> >::type {aka int}]' for array subscript
66 | if (v != parent && !roots[v])
| ^
race.cpp: In function 'int centroid(int, int, int)':
race.cpp:75:53: error: invalid types 'bool[std::tuple_element<0, std::pair<int, int> >::type {aka int}]' for array subscript
75 | if (v != parent && sub[v] > size/2 && !roots[v])
| ^
race.cpp: In function 'void algorithm(int)':
race.cpp:94:18: error: invalid types 'bool[std::tuple_element<0, std::pair<int, int> >::type {aka int}]' for array subscript
94 | if(!roots[v]){
| ^
race.cpp:100:10: error: invalid types 'bool[int]' for array subscript
100 | roots[newRoot] = true;
| ^
race.cpp:103:18: error: invalid types 'bool[std::tuple_element<0, std::pair<int, int> >::type {aka int}]' for array subscript
103 | if(!roots[v]){
| ^
race.cpp: In function 'int best_path(int, int, int (*)[2], int*)':
race.cpp:120:12: error: cannot convert 'bool' to 'void*'
120 | memset(roots, false, sizeof(roots)); // inicializa o vetor de centroids
| ^~~~~
| |
| bool
In file included from /usr/include/features.h:502,
from /usr/include/x86_64-linux-gnu/c++/13/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/13/bits/c++config.h:679,
from /usr/include/c++/13/cassert:43,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:33,
from race.cpp:1:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:57:1: note: initializing argument 1 of 'void* memset(void*, int, size_t)'
57 | __NTH (memset (void *__dest, int __ch, size_t __len))
| ^~~~~