QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#626953#8242. V-DiagramMaMengQiCompile Error//C++23882b2024-10-10 14:11:232024-10-10 14:11:29

Details

answer.code: In function ‘int main()’:
answer.code:37:26: error: no matching function for call to ‘max(<brace-enclosed initializer list>)’
   37 |                 ans = max({ (1.0 * ans / 3) ,1.0 * (ans + sum1) / (pos + 1) ,1.0 * (ans + sum2) / (n - pos + 2) ,1.0 * (ans + sum1 + sum2) / n });
      |                       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/string:51,
                 from /usr/include/c++/13/bits/locale_classes.h:40,
                 from /usr/include/c++/13/bits/ios_base.h:41,
                 from /usr/include/c++/13/ios:44,
                 from /usr/include/c++/13/ostream:40,
                 from /usr/include/c++/13/iostream:41,
                 from answer.code:3:
/usr/include/c++/13/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/include/c++/13/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
answer.code:37:26: note:   candidate expects 2 arguments, 1 provided
   37 |                 ans = max({ (1.0 * ans / 3) ,1.0 * (ans + sum1) / (pos + 1) ,1.0 * (ans + sum2) / (n - pos + 2) ,1.0 * (ans + sum1 + sum2) / n });
      |                       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/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/include/c++/13/bits/stl_algobase.h:303:5: note:   template argument deduction/substitution failed:
answer.code:37:26: note:   candidate expects 3 arguments, 1 provided
   37 |                 ans = max({ (1.0 * ans / 3) ,1.0 * (ans + sum1) / (pos + 1) ,1.0 * (ans + sum2) / (n - pos + 2) ,1.0 * (ans + sum1 + sum2) / n });
      |                       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~