Skip to content

Commit 847d788

Browse files
committed
[BOJ] #14916. 거스름돈 / 실버5 / 20분 / 성공
1 parent 739b69c commit 847d788

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import sys
2+
input = sys.stdin.readline
3+
4+
n = int(input()) # 거스름돈 액수
5+
6+
dp = [0] * (n+1)
7+
# 0 1 2 3 4 5 6 7 8 9
8+
dp[:10] = [-1,-1,1,-1,2,1,3,2,4,3]
9+
10+
for i in range(10,n+1):
11+
dp[i] = dp[i-5] + 1
12+
13+
print(dp[n])

0 commit comments

Comments
 (0)