Problem duckhunt25
User YSH2020
Submission Time 2025-12-08 11:41:14
Score 0
Max Time N/A
Max Memory N/A

Compile Error

duckhunt25.cpp: In function ‘int main()’:
duckhunt25.cpp:8:15: error: no matching function for call to ‘sort(int [n][m], int (*)[m])’
8 | sort(a, a+n*m);
| ^
In file included from /usr/include/c++/9/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
from duckhunt25.cpp:1:
/usr/include/c++/9/bits/stl_algo.h:4863:5: note: candidate: ‘template<class _RAIter> void std::sort(_RAIter, _RAIter)’
4863 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
| ^~~~
/usr/include/c++/9/bits/stl_algo.h:4863:5: note: template argument deduction/substitution failed:
duckhunt25.cpp:8:15: note: variable-sized array type ‘int (*)[m]’ is not a valid template argument
8 | sort(a, a+n*m);
| ^
In file included from /usr/include/c++/9/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,<