QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#353582#8258. Gift ExchangehyforcesCompile Error//C++203.3kb2024-03-14 11:30:272024-03-14 11:30:28

Details

answer.code: In function ‘int main()’:
answer.code:99:26: error: no matching function for call to ‘upper_bound(int*, std::pair<int, int>*, int&, main()::<lambda(int, int)>)’
   99 |         int u=upper_bound(ord+1,arr+n+1,arr[a].second,[&](int x,int y)->bool{
      |               ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  100 |             return arr[x].first<y;
      |             ~~~~~~~~~~~~~~~~~~~~~~
  101 |         })-ord-1;
      |         ~~                
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:2061:5: note: candidate: ‘template<class _FIter, class _Tp> constexpr _FIter std::upper_bound(_FIter, _FIter, const _Tp&)’
 2061 |     upper_bound(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:2061:5: note:   template argument deduction/substitution failed:
answer.code:99:26: note:   deduced conflicting types for parameter ‘_FIter’ (‘int*’ and ‘std::pair<int, int>*’)
   99 |         int u=upper_bound(ord+1,arr+n+1,arr[a].second,[&](int x,int y)->bool{
      |               ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  100 |             return arr[x].first<y;
      |             ~~~~~~~~~~~~~~~~~~~~~~
  101 |         })-ord-1;
      |         ~~                
/usr/include/c++/13/bits/stl_algo.h:2092:5: note: candidate: ‘template<class _FIter, class _Tp, class _Compare> constexpr _FIter std::upper_bound(_FIter, _FIter, const _Tp&, _Compare)’
 2092 |     upper_bound(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:2092:5: note:   template argument deduction/substitution failed:
answer.code:99:26: note:   deduced conflicting types for parameter ‘_FIter’ (‘int*’ and ‘std::pair<int, int>*’)
   99 |         int u=upper_bound(ord+1,arr+n+1,arr[a].second,[&](int x,int y)->bool{
      |               ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  100 |             return arr[x].first<y;
      |             ~~~~~~~~~~~~~~~~~~~~~~
  101 |         })-ord-1;
      |         ~~