Explanation of lower_bound function.

Правка en1, от 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.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский AHMADUL 2020-02-26 07:52:33 442 Initial revision (published)