[바미] 나무 자르기
·
하루 알고리즘(JS)
문제 https://www.acmicpc.net/problem/2805코드const fs = require('fs');const input = fs.readFileSync('/dev/stdin').toString().trim().split('\n');const [N, M] = input[0].split(' ').map(Number);const trees = input[1].split(' ').map(Number);function getMaxSawHeight(N, M, trees) { let low = 0; let high = Math.max(...trees); let result = 0; while (low { if (height > mid) { ..