Explanation of lower_bound function.

Revision en1, by AHMADUL, 2020-02-26 07:52:33

I was trying to solve problem B1 of Helvetic Coding Contest 2019 online mirror (teams allowed, unrated). I got WA and TLE for a several time.Then I went to standings and found a line from a submission: int f=lower_bound(dg,dg+b,make_pair(a[i],10000000))-dg;
But,I couldn't understand it,,why I have to subtract dg at last??? Now, I am badly in need of help.Someone please explain the above statement.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English AHMADUL 2020-02-26 07:52:33 442 Initial revision (published)