hellomoto's blog

By hellomoto, history, 6 years ago, In English

if(1<=A[i]<=2*1e9)

vector<long long int>A;
auto it=upper_bound(A.begin(),A.end(),1000000000);

is it overflows? why it is giving wrong answer for me in c++.

  • Vote: I like it
  • -19
  • Vote: I do not like it

»
6 years ago, # |
Rev. 2   Vote: I like it -11 Vote: I do not like it

vectorA; auto it=upper_bound(A.begin(),A.end(),1000000000)-A.begin();

»
6 years ago, # |
  Vote: I like it +8 Vote: I do not like it

Is the vector A sorted?