https://www.acmicpc.net/problem/24087
24087번: アイスクリーム (Ice Cream)
JOI アイスクリーム店は,非常に高さのあるアイスクリームタワーが名物のアイスクリーム店である.アイスクリームタワーとは,ベースとなるアイスクリームの上に,追加のアイスクリーム
www.acmicpc.net
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
from math import ceil
def sol(s, a, b):
answer = 250
cost = 100
if s <= a:
return answer
else:
cnt = ceil((s - a) / b)
return answer + cnt * cost
if __name__ == '__main__':
s = int(input())
a = int(input())
b = int(input())
print(sol(s, a, b))
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
백준 30501 관공... 어찌하여 목만 오셨소... (0) | 2024.04.18 |
---|---|
백준 31090 2023은 무엇이 특별할까? (0) | 2024.04.18 |
백준 28290 안밖? 밖안? 계단? 역계단? (0) | 2024.04.17 |
백준 31495 그게 무슨 코드니.. (0) | 2024.04.16 |
백준 30999 민주주의 (0) | 2024.04.16 |
댓글