(1).백준 34529번 Acquiring SW-IT Corn는 다양한 옥수수콘을 구매할 때

들어갈 최소 금액을 구해야 하는 문제였는데

캔단위?로 구매하기 때문에 Math.ceil로 캔 단위를 표현했고 나머지는 그대로 수량과 금액을 곱해줬다.

const input = `600 400 300
1000 800 400`.split('\n').map(el => el.split(' ').map(Number))


console.log(input)

console.log(Math.ceil(input[1][0] / 100) * input[0][0] + Math.ceil(input[1][1] / 50) * input[0][1] + Math.ceil(input[1][2] / 20) * input[0][2])

'회고' 카테고리의 다른 글

[개발일지] - 823(주말)  (0) 2025.10.05
[개발일지] - 822(개천절)  (0) 2025.10.03
[개발일지] - 820  (0) 2025.10.01
[개발일지] - 819  (0) 2025.09.30
[개발일지] - 818  (0) 2025.09.29

+ Recent posts