tak.cpp: In function 'int main()':
tak.cpp:16:29: error: no matching function for call to 'max(int, ll)'
x += max(0, a[i] - (b - x));
^
In file included from /usr/include/c++/5/bits/char_traits.h:39:0,
from /usr/include/c++/5/ios:40,
from /usr/include/c++/5/istream:38,
from /usr/include/c++/5/sstream:38,
from /usr/include/c++/5/complex:45,
from /usr/include/c++/5/ccomplex:38,
from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:52,
from tak.cpp:1:
/usr/include/c++/5/bits/stl_algobase.h:219:5: note: candidate: template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)
max(const _Tp& __a, const _Tp& __b)
^
/usr/include/c++/5/bits/stl_algobase.h:219:5: note: template argument deduction/substitution failed:
tak.cpp:16:29: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll {aka long long int}')
x += max(0, a[i] - (b - x));
^
In file included from /usr/include/c++/5/bits/char_traits.h:39:0,
from /usr/include/c++/5/ios:40,
from /usr/include/c++/5/istream:38,
from /usr/include/c++/5/sstream:38,
from /usr/include/c++/5/complex:45,
from /usr/include/c++/5/ccomplex:38,
from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:52,
from tak.cpp:1:
/usr/include/c++/5/bits/stl_algobase.h:265:5: note: candidate: template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
/usr/include/c++/5/bits/stl_algobase.h:265:5: note: template argument deduction/substitution failed:
tak.cpp:16:29: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll {aka long long int}')
x += max(0, a[i] - (b - x));
^
In file included from /usr/include/c++/5/algorithm:62:0,
from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:64,
from tak.cpp:1:
/usr/include/c++/5/bits/stl_algo.h:3457:5: note: candidate: template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)
max(initializer_list<_Tp> __l)
^
/usr/include/c++/5/bits/stl_algo.h:3457:5: note: template argument deduction/substitution failed:
tak.cpp:16:29: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
x += max(0, a[i] - (b - x));
^
In file included from /usr/include/c++/5/algorithm:62:0,
from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:64,
from tak.cpp:1:
/usr/include/c++/5/bits/stl_algo.h:3463:5: note: candidate: template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)
max(initializer_list<_Tp> __l, _Compare __comp)
^
/usr/include/c++/5/bits/stl_algo.h:3463:5: note: template argument deduction/substitution failed:
tak.cpp:16:29: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
x += max(0, a[i] - (b - x));
^
tak.cpp:18:11: error: 'm' was not declared in this scope
if(x >= m){
^
tak.cpp:9:33: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%lld%lld%d", &d, &b, &n);
^
tak.cpp:10:49: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for(int i = 0; i < n; i++) scanf("%lld", a + i);
^