Lower Bound in Map C++

Revision en1, by og_prakash, 2023-12-30 00:30:32

Whats the difference between these 2

map.lower_bound(val) vs lower_bound(map.begin(),map.end(),val)

i was getting tle on https://codeforces.net/contest/1902/submission/239546603

correct on https://codeforces.net/contest/1902/submission/239546733

with just 1 line change

TLE -> auto it = lb(mp2[(p4.fi+n)][p4.se].begin(), mp2[(p4.fi+n)][p4.se].end(), l-1);
CORRECT -> auto it=mp2[(p4.fi+n)][p4.se].lb(l-1);

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English og_prakash 2023-12-30 00:30:32 496 Initial revision (published)