We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b5604cc commit a600cedCopy full SHA for a600ced
1 file changed
live8/test86/문제2/황장현.js
@@ -0,0 +1,22 @@
1
+const input = require('fs')
2
+ .readFileSync(process.platform === 'linux' ? '/dev/stdin' : './input.txt')
3
+ .toString()
4
+ .trim()
5
+ .split('\n')
6
+ .map((el) => el.split(' ').map(Number));
7
+
8
+function solution(input) {
9
+ const N = input[0][0];
10
+ const 지방예산요청 = input[1].sort((a, b) => a - b);
11
+ const M = input[2][0];
12
13
+ let high = 지방예산요청[N - 1];
14
+ let low = 0;
15
16
+ while (low <= high) {
17
+ const mid = Math.floor((low + high) / 2);
18
+ const sum = 지방예산요청.reduce((acc, v) => acc + (v <= mid ? v : mid), 0);
19
+ }
20
+}
21
22
+console.log(solution(input));
0 commit comments