Problem arrayfind
User dminh
Submission Time 2023-03-17 17:48:00
Score 0
Max Time N/A
Max Memory N/A

Compile Error

arrayfind.cpp: In function ‘int main()’:
arrayfind.cpp:13:95: error: no match for ‘operator-’ (operand types are ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’} and ‘__gnu_cxx::__normal_iterator<int*, std::vector<int> >’)
13 | cout<<"Smaller: "<<lower_bound(a.begin(),a.end(),k)-a.begin()<<", Greater: "<<a.back()-upper_bound(a.begin(),a.end(),k)-a.begin()<<"\n";
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | __gnu_cxx::__normal_iterator<int*, std::vector<int> >
|