/in/foo.cc: In function 'void solve()':
/in/foo.cc:17:17: error: missing template arguments before 'M'
17 | std::vector M(n + 2, std::vector(n + 2, 0));
| ^
/in/foo.cc:22:38: error: 'M' was not declared in this scope
22 | if (i >= 1 && i <= n) a[i] = M[i][i] = x;
| ^
/in/foo.cc:24:35: error: 'M' was not declared in this scope
24 | rep(i, 1, n) rep(j, i + 1, n) M[i][j] = std::max(M[i][j - 1], a[j]);
| ^
/in/foo.cc:26:17: error: missing template arguments before 'f'
26 | std::vector f(n + 2, std::vector(n + 2, std::vector(2, inf)));
| ^
/in/foo.cc:27:5: error: 'f' was not declared in this scope
27 | f[1][n][0] = f[1][n][1] = 0;
| ^
/in/foo.cc:31:31: error: 'M' was not declared in this scope
31 | {f[i - 1][j][0] + M[i - 1][j],
| ^
/in/foo.cc:30:30: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
30 | f[i][j][0] = std::min(
| ~~~~~~~~^
31 | {f[i - 1][j][0] + M[i - 1][j],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 | f[i - 1][j][1] + (n - k) * M[i - 1][j],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33 | f[i][j + 1][1] + (n - k + 1) * M[i][j + 1]}
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34 | );
| ~
In file included from /usr/include/c++/12/algorithm:60,
from /in/foo.cc:1:
/usr/include/c++/12/bits/stl_algobase.h:230:5: note: candidate: 'template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)'
230 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/12/bits/stl_algobase.h:230:5: note: template argument deduction/substitution failed:
/in/foo.cc:30:30: note: candidate expects 2 arguments, 1 provided
30 | f[i][j][0] = std::min(
| ~~~~~~~~^
31 | {f[i - 1][j][0] + M[i - 1][j],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 | f[i - 1][j][1] + (n - k) * M[i - 1][j],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33 | f[i][j + 1][1] + (n - k + 1) * M[i][j + 1]}
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34 | );
| ~
/usr/include/c++/12/bits/stl_algobase.h:278:5: note: candidate: 'template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
278 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/12/bits/stl_algobase.h:278:5: note: template argument deduction/substitution failed:
/in/foo.cc:30:30: note: candidate expects 3 arguments, 1 provided
30 | f[i][j][0] = std::min(
| ~~~~~~~~^
31 | {f[i - 1][j][0] + M[i - 1][j],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 | f[i - 1][j][1] + (n - k) * M[i - 1][j],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33 | f[i][j + 1][1] + (n - k + 1) * M[i][j + 1]}
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34 | );
| ~
In file included from /usr/include/c++/12/algorithm:61:
/usr/include/c++/12/bits/stl_algo.h:5726:5: note: candidate: 'template<class _Tp> _Tp std::min(initializer_list<_Tp>)'
5726 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/12/bits/stl_algo.h:5726:5: note: template argument deduction/substitution failed:
/usr/include/c++/12/bits/stl_algo.h:5736:5: note: candidate: 'template<class _Tp, class _Compare> _Tp std::min(initializer_list<_Tp>, _Compare)'
5736 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/12/bits/stl_algo.h:5736:5: note: template argument deduction/substitution failed:
/in/foo.cc:35:30: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
35 | f[i][j][1] = std::min(
| ~~~~~~~~^
36 | {f[i][j + 1][1] + M[i][j + 1],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | f[i][j + 1][0] + (n - k) * M[i][j + 1],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38 | f[i - 1][j][0] + (n - k + 1) * M[i - 1][j]}
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39 | );
| ~
/usr/include/c++/12/bits/stl_algobase.h:230:5: note: candidate: 'template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)'
230 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/12/bits/stl_algobase.h:230:5: note: template argument deduction/substitution failed:
/in/foo.cc:35:30: note: candidate expects 2 arguments, 1 provided
35 | f[i][j][1] = std::min(
| ~~~~~~~~^
36 | {f[i][j + 1][1] + M[i][j + 1],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | f[i][j + 1][0] + (n - k) * M[i][j + 1],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38 | f[i - 1][j][0] + (n - k + 1) * M[i - 1][j]}
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39 | );
| ~
/usr/include/c++/12/bits/stl_algobase.h:278:5: note: candidate: 'template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
278 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/12/bits/stl_algobase.h:278:5: note: template argument deduction/substitution failed:
/in/foo.cc:35:30: note: candidate expects 3 arguments, 1 provided
35 | f[i][j][1] = std::min(
| ~~~~~~~~^
36 | {f[i][j + 1][1] + M[i][j + 1],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | f[i][j + 1][0] + (n - k) * M[i][j + 1],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38 | f[i - 1][j][0] + (n - k + 1) * M[i - 1][j]}
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39 | );
| ~
/usr/include/c++/12/bits/stl_algo.h:5726:5: note: candidate: 'template<class _Tp> _Tp std::min(initializer_list<_Tp>)'
5726 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/12/bits/stl_algo.h:5726:5: note: template argument deduction/substitution failed:
/usr/include/c++/12/bits/stl_algo.h:5736:5: note: candidate: 'template<class _Tp, class _Compare> _Tp std::min(initializer_list<_Tp>, _Compare)'
5736 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/12/bits/stl_algo.h:5736:5: note: template argument deduction/substitution failed: