파비의 매일매일 공부기록

[BOJ] 1350 본문

Problem Solving/BOJ

[BOJ] 1350

fabichoi 2022. 2. 12. 23:45

https://www.acmicpc.net/problem/1350 

클러스터에 하나의 파일만 들어갈 수 있는 조건 때문에 그렇게 어려운 문제는 아닌듯.

# BOJ 1350
n = int(input())
files = map(int, input().split(' '))
cluster = int(input())
res = 0
for file in files:
    if file == 0:
        continue
    m = file // cluster
    if file % cluster > 0:
        m += 1
    res += cluster * m
print(res)

 

반응형

'Problem Solving > BOJ' 카테고리의 다른 글

[BOJ] 1357  (0) 2022.02.14
[BOJ] 1356  (0) 2022.02.13
[BOJ] 1340 [재시도 필요]  (0) 2022.02.11
[BOJ] 1333  (0) 2022.02.10
[BOJ] 1330  (0) 2022.02.09
Comments