QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#741065#9714. A Colorful GridAlterego#Compile Error//C++237.6kb2024-11-13 13:12:382024-11-13 13:12:39

Details

answer.code:23:25: error: ‘int y1 [100100]’ redeclared as different kind of entity
   23 | int x1[100100],y1[100100],x2[100100],y2[100100],c[100100];
      |                         ^
In file included from /usr/include/features.h:461,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/c++config.h:679,
                 from /usr/include/c++/13/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:33,
                 from answer.code:2:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:221:1: note: previous declaration ‘double y1(double)’
  221 | __MATHCALL (y1,, (_Mdouble_));
      | ^~~~~~~~~~
answer.code: In function ‘int solve1(int)’:
answer.code:50:39: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   50 |                         int l=min(y1[i],y2[i]);
      |                                       ^
answer.code:50:34: error: no matching function for call to ‘min(double (&)(double) noexcept, int&)’
   50 |                         int l=min(y1[i],y2[i]);
      |                               ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51:
/usr/include/c++/13/bits/stl_algobase.h:233:5: note: candidate: ‘template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)’
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
answer.code:50:34: note:   deduced conflicting types for parameter ‘const _Tp’ (‘double(double) noexcept’ and ‘int’)
   50 |                         int l=min(y1[i],y2[i]);
      |                               ~~~^~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:281:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)’
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:281:5: note:   template argument deduction/substitution failed:
answer.code:50:34: note:   deduced conflicting types for parameter ‘const _Tp’ (‘double(double) noexcept’ and ‘int’)
   50 |                         int l=min(y1[i],y2[i]);
      |                               ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:61:
/usr/include/c++/13/bits/stl_algo.h:5775:5: note: candidate: ‘template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)’
 5775 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/13/bits/stl_algo.h:5775:5: note:   template argument deduction/substitution failed:
answer.code:50:34: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘double (*)(double) noexcept’
   50 |                         int l=min(y1[i],y2[i]);
      |                               ~~~^~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5785:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)’
 5785 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algo.h:5785:5: note:   template argument deduction/substitution failed:
answer.code:50:34: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘double (*)(double) noexcept’
   50 |                         int l=min(y1[i],y2[i]);
      |                               ~~~^~~~~~~~~~~~~
answer.code:51:39: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   51 |                         int r=max(y1[i],y2[i]);
      |                                       ^
answer.code:51:34: error: no matching function for call to ‘max(double (&)(double) noexcept, int&)’
   51 |                         int r=max(y1[i],y2[i]);
      |                               ~~~^~~~~~~~~~~~~
/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:51:34: note:   deduced conflicting types for parameter ‘const _Tp’ (‘double(double) noexcept’ and ‘int’)
   51 |                         int r=max(y1[i],y2[i]);
      |                               ~~~^~~~~~~~~~~~~
/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:51:34: note:   deduced conflicting types for parameter ‘const _Tp’ (‘double(double) noexcept’ and ‘int’)
   51 |                         int r=max(y1[i],y2[i]);
      |...