Skip to content

Commit b12fe77

Browse files
author
Eric
committed
86차 2번 문제풀이
1 parent a600ced commit b12fe77

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

live8/test86/문제2/황장현.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ function solution(input) {
1616
while (low <= high) {
1717
const mid = Math.floor((low + high) / 2);
1818
const sum = 지방예산요청.reduce((acc, v) => acc + (v <= mid ? v : mid), 0);
19+
if (sum > M) {
20+
high = mid - 1;
21+
} else {
22+
low = mid + 1;
23+
}
1924
}
25+
return high;
2026
}
2127

2228
console.log(solution(input));

0 commit comments

Comments
 (0)