Problem swords
User GanJaeHan
Submission Time 2026-02-20 16:55:45
Score 0
Max Time N/A
Max Memory N/A

Compile Error

swords.cpp: In function ‘int main()’:
swords.cpp:7:11: error: reference to ‘max’ is ambiguous
7 | int a[max], b[max];
| ^~~
In file included from /usr/include/c++/9/bits/char_traits.h:39,
from /usr/include/c++/9/ios:40,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from swords.cpp:1:
/usr/include/c++/9/bits/stl_algobase.h:268:5: note: candidates are: ‘template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
268 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/9/bits/stl_algobase.h:222:5: note: ‘template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)’
222 | max(const _Tp& __a, const _Tp& __b)
| ^~~
swords.cpp:3:11: note: ‘const int max’
3 | const int max