Why set::lower_bound() and std::lower_bound() function does not work the same?

Revision en1, by Lix2002, 2023-10-23 16:25:59

Well I just found this wierd thing when I was doing the problem Codeforces Round 905 (Div. 3) Prob.D When I use std::find(set.begin(), set.end(), value) or std::lower_bound(set.begin(), set.end(), value), I would get a TLE. But instead of using that, when I replace them with set.find(value) or set.lower_bound(value) it passed and worked as expected. Why would this happened? Is there any difference between these two approaches?

Tags lower_bound, find, multiset

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English Lix2002 2023-10-23 16:27:03 13 Tiny change: 'it passed and worke' -> 'it passed smoothly and worke' (published)
en2 English Lix2002 2023-10-23 16:26:28 12
en1 English Lix2002 2023-10-23 16:25:59 560 Initial revision (saved to drafts)