Problem binarysearch
User suzienguyen
Submission Time 2026-06-25 21:23:29
Score 0
Max Time N/A
Max Memory N/A

Compile Error

binarysearch.cpp: In function ‘int32_t main()’:
binarysearch.cpp:19:44: error: no matching function for call to ‘lower_bound(std::vector<long long int>::iterator, <unresolved overloaded function type>, long long int&)’
19 | idx = lower_bound(A.begin(), A.end, query);
| ^
In file included from /usr/include/c++/9/bits/specfun.h:45,
from /usr/include/c++/9/cmath:1927,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:41,
from binarysearch.cpp:1:
/usr/include/c++/9/bits/stl_algobase.h:1004:5: note: candidate: ‘_ForwardIterator std::lower_bound(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Tp = long long int]’
1004 | lower_bound(_ForwardIterator __first, _ForwardIterator __last,
| ^~~~~~~~~~~
/usr/include/c++/9