michael_jordon's blog

By michael_jordon, history, 4 years ago, In English

question link : https://codeforces.net/problemset/problem/459/D solution link: https://codeforces.net/contest/459/submission/103579274

here if i am using arr[i]=upper_bound(arr1.begin(),arr1.begin()+n1,arr[i])-arr1.begin(); than it is showing wrong answer . why?

pls help.

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

»
4 years ago, # |
  Vote: I like it +12 Vote: I do not like it

lower_bound finds the first element (or position of element) that is not less than X

upper_bound finds the first element (or position of element) that is strictly more than X