OKKY
커뮤니티
Q&A
지식
이벤트
Contact
부트캠프
Jobs
Search Bar
로그인
회원가입
lower-bound
전체
최신순
질문하기
해결
1
기분좋은바람
·
2년 이상
224
1
해결 1
lower_bound/upper_bound 비교함수 가 왜 이렇게 생겼는지 이해가 잘 가지 않습니다...
lower_bound 일때 비교함수가 bool comp(int& a, int value) { return a<value; }왜 이런식인지, 내부적으로 어떻게 돌아가길래 이렇게 되는 건지 이해하기 좀 어렵습니다. 이진탐색에 사용하는 하는 것이라서 value보다 같거나 큰 것을 찾는데 기준이 된다 라고 하면, 어느정도 이해가 되는 것 같긴합니다.... 그렇다면 upper_bound는 bool comp(int& a, int
해결
1
기분좋은바람
·
2년 이상
648
0
해결 1
set<pair<int,int>> 의 lower_bound, upper_bound 질문입니다.....
set<pair<int, int>> test; test.insert({ 30,10 }); test.insert({ 10,50 }); test.insert({ 100,-50 }); test.insert({ 50,0 }); test.insert({ 70,60 }); auto iter = test.lower_bound({ 30,9999 }); // {50,0} 이 반환됨....
Search Bar