foo.cc: In function ‘int main()’:
foo.cc:19:55: error: no matching function for call to ‘max(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&, __gnu_cxx::__promote_2<int, long long int, double, double>::__type)’
19 | dp[i][g] = max(dp[i][g], dp[i][k] + dp[k][i] + pow(2,g-i-1));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /nix/gcc-13.3.0/include/c++/13.3.0/algorithm:60,
from stdc++.h:51:
/nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algobase.h:257:5: note: candidate: ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
foo.cc:19:55: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘__gnu_cxx::__promote_2<int, long long int, double, double>::__type’ {aka ‘double’})
19 | dp[i][g] = max(dp[i][g], dp[i][k] + dp[k][i] + pow(2,g-i-1));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algobase.h:303:5: note: candidate: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algobase.h:303:5: note: template argument deduction/substitution failed:
foo.cc:19:55: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘__gnu_cxx::__promote_2<int, long long int, double, double>::__type’ {aka ‘double’})
19 | dp[i][g] = max(dp[i][g], dp[i][k] + dp[k][i] + pow(2,g-i-1));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /nix/gcc-13.3.0/include/c++/13.3.0/algorithm:61:
/nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algo.h:5795:5: note: candidate: ‘template<class _Tp> _Tp std::max(initializer_list<_Tp>)’
5795 | max(initializer_list<_Tp> __l)
| ^~~
/nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algo.h:5795:5: note: template argument deduction/substitution failed:
foo.cc:19:55: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’
19 | dp[i][g] = max(dp[i][g], dp[i][k] + dp[k][i] + pow(2,g-i-1));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algo.h:5805:5: note: candidate: ‘template<class _Tp, class _Compare> _Tp std::max(initializer_list<_Tp>, _Compare)’
5805 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algo.h:5805:5: note: template argument deduction/substitution failed:
foo.cc:19:55: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’
19 | dp[i][g] = max(dp[i][g], dp[i][k] + dp[k][i] + pow(2,g-i-1));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foo.cc:23:26: error: ‘i’ was not declared in this scope
23 | ans += a[i];
| ^