Problem arrayfind
User Yizhou
Submission Time 2024-06-02 13:19:08
Score 0
Max Time N/A
Max Memory N/A

Compile Error

arrayfind.cpp: In function ‘int main()’:
arrayfind.cpp:20:28: error: cannot convert ‘__gnu_cxx::__normal_iterator<int*, std::vector<int> >’ to ‘int*’ in initialization
20 | int *smallest=lower_bound(nums.begin(),nums.end(),no);
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| __gnu_cxx::__normal_iterator<int*, std::vector<int> >
arrayfind.cpp:21:17: error: no match for ‘operator-’ (operand types are ‘int’ and ‘__gnu_cxx::__normal_iterator<int*, std::vector<int> >’)
21 | int *biggest=l-upper_bound(nums.begin(),nums.end(),no);
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| int __gnu_cxx::__normal_iterator<int*, std::vector<int> >
In file included from /usr/include/c++/9/bits/stl_algobase.h:67,
from /usr/inc