Why two seemingly lower_bound() same method has different processing time
问题 While I solve an algorithm question, My solution couldn't get passed because of time issue. But I realized that the only difference between passed one and mine was bag.lower_bound(jewerly[i].first) != bag.end() //passed lower_bound(bag.begin(), bag.end(), jewerly[i].first) != bag.end() //failed I've already checked it with clock() and It was obviously slower than the other one. what makes the difference between the two codes? #include <cstdio> #include <set> #include <algorithm> using