Borderou de evaluare (job #751537)
Utilizator |
|
IP | ascuns |
---|---|---|---|
Problemă | Rucsac 1 | Compilator | cpp-32 |
Rundă | vs_11_12_dec | Status | evaluat |
Dată | 16 dec. 2023 11:38:00 | Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp: In function 'int main()':
main.cpp:29:31: error: no matching function for call to 'max(short int&, int)'
29 | dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - g[i]] + v[i]);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/algorithm:60,
from /usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/i686-pc-linux-gnu/bits/stdc++.h:51,
from main.cpp:1:
/usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
main.cpp:29:31: note: deduced conflicting types for parameter 'const _Tp' ('short int' and 'int')
29 | dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - g[i]] + v[i]);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/stl_algobase.h:303:5: note: template argument deduction/substitution failed:
main.cpp:29:31: note: deduced conflicting types for parameter 'const _Tp' ('short int' and 'int')
29 | dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - g[i]] + v[i]);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/algorithm:61:
/usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/stl_algo.h:5795:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5795 | max(initializer_list<_Tp> __l)
| ^~~
/usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/stl_algo.h:5795:5: note: template argument deduction/substitution failed:
main.cpp:29:31: note: mismatched types 'std::initializer_list<_Tp>' and 'short int'
29 | dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - g[i]] + v[i]);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/stl_algo.h:5805:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5805 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/stl_algo.h:5805:5: note: template argument deduction/substitution failed:
main.cpp:29:31: note: mismatched types 'std::initializer_list<_Tp>' and 'short int'
29 | dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - g[i]] + v[i]);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:35:19: error: no matching function for call to 'max(int&, short int&)'
35 | maxi = max(maxi, dp[n][j]);
| ~~~^~~~~~~~~~~~~~~~
/usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
main.cpp:35:19: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'short int')
35 | maxi = max(maxi, dp[n][j]);
| ~~~^~~~~~~~~~~~~~~~
/usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/stl_algobase.h:303:5: note: template argument deduction/substitution failed: