Replies: 1 comment
-
|
코드가 아주 깔끔하네여~~ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
문제 : https://www.acmicpc.net/problem/2512
아이디어
정해진 총액 이하에서 가능한 한 최대의 총 예산을 구해야 하는 문제로 " 최대 " 라는 키워드가 나왔으니 먼저 이분 탐색을 고려해본다.
원래 문제
이분탐색을 위해 상한선을 H라고 하고 문제를 뒤집어서 Yes or No 문제로 만든다.
뒤집어서 만든 Yes or No 문제
이분탐색을 진행해서 상한선 H 마다 Yes or No를 채우고 마지막 Yes인 H를 찾아낸다.
H의 범위는 1~요청 예산의 최대값.
시간 복잡도
점점 풀이에 익숙해지는 것 같다 오예
구현
Beta Was this translation helpful? Give feedback.
All reactions