QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#665432#6130. Plants vs. Zombiesucup-team5375#Compile Error//C++201.2kb2024-10-22 12:41:122024-10-22 12:41:13

Details

answer.code: In function ‘void solve()’:
answer.code:14:45: error: no matching function for call to ‘max_element(std::vector<int>&)’
   14 |     ll ans = 0, l = 1, r = m * (*max_element(a));
      |                                  ~~~~~~~~~~~^~~
In file included from /usr/include/c++/13/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51,
                 from answer.code:1:
/usr/include/c++/13/bits/stl_algo.h:5730:5: note: candidate: ‘template<class _FIter> constexpr _FIter std::max_element(_FIter, _FIter)’
 5730 |     max_element(_ForwardIterator __first, _ForwardIterator __last)
      |     ^~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5730:5: note:   template argument deduction/substitution failed:
answer.code:14:45: note:   candidate expects 2 arguments, 1 provided
   14 |     ll ans = 0, l = 1, r = m * (*max_element(a));
      |                                  ~~~~~~~~~~~^~~
/usr/include/c++/13/bits/stl_algo.h:5755:5: note: candidate: ‘template<class _FIter, class _Compare> constexpr _FIter std::max_element(_FIter, _FIter, _Compare)’
 5755 |     max_element(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5755:5: note:   template argument deduction/substitution failed:
answer.code:14:45: note:   candidate expects 3 arguments, 1 provided
   14 |     ll ans = 0, l = 1, r = m * (*max_element(a));
      |                                  ~~~~~~~~~~~^~~
In file included from /usr/include/c++/13/algorithm:73:
/usr/include/c++/13/pstl/glue_algorithm_defs.h:524:1: note: candidate: ‘template<class _ExecutionPolicy, class _ForwardIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::max_element(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Compare)’
  524 | max_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp);
      | ^~~~~~~~~~~
/usr/include/c++/13/pstl/glue_algorithm_defs.h:524:1: note:   template argument deduction/substitution failed:
answer.code:14:45: note:   candidate expects 4 arguments, 1 provided
   14 |     ll ans = 0, l = 1, r = m * (*max_element(a));
      |                                  ~~~~~~~~~~~^~~
/usr/include/c++/13/pstl/glue_algorithm_defs.h:528:1: note: candidate: ‘template<class _ExecutionPolicy, class _ForwardIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::max_element(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator)’
  528 | max_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
      | ^~~~~~~~~~~
/usr/include/c++/13/pstl/glue_algorithm_defs.h:528:1: note:   template argument deduction/substitution failed:
answer.code:14:45: note:   candidate expects 3 arguments, 1 provided
   14 |     ll ans = 0, l = 1, r = m * (*max_element(a));
      |                                  ~~~~~~~~~~~^~~