알고리즘 문제 풀기/BOJ
BOJ 11047 - 동전 0
bug_maker
2019. 12. 24. 13:57
https://www.acmicpc.net/problem/11047
BOJ 11047 - 동전 0
작성언어: Python3
n, k = map(int, input().split())
a = []
cnt = 0
for i in range(n):
a.append(int(input()))
a.reverse()
for money in a:
if(money <= k):
while(money <= k):
k -= money
cnt += 1
if(k == 0):
break
print(cnt)
pc 환경에서 코드를 보는 것을 권장합니다.