๋ฐ์ํ
๋ฐฑ์ค 11047๋ฒ [๋์ 0]
ํ์ด)
# ์ต์ข
์ ์ถ
lst = list(map(int,(input().split())))
a_lst = [int(input()) for _ in range(lst[0])]
k = lst[1]
cnt = 0
for i in range(len(a_lst)-1,-1,-1) :
cnt += k//a_lst[i]
k = k%a_lst[i]
print(cnt)
# ==> ๋ฉ๋ชจ๋ฆฌ : 28776kb, ์๊ฐ : 76ms, ์ฝ๋๊ธธ์ด : 193B
728x90
๋ฐ์ํ
'๋ฐฑ์ค & ํ๋ก๊ทธ๋๋จธ์ค > greedy' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค 1541] [greedy] ์์ด๋ฒ๋ฆฐ ๊ดํธ (0) | 2021.04.18 |
---|---|
[๋ฐฑ์ค 1931] [greedy] ํ์์ค ๋ฐฐ์ โ (0) | 2021.04.18 |
[๋ฐฑ์ค 11399] [greedy] ATM (0) | 2021.04.17 |
[๋ฐฑ์ค 2839] [greedy] ์คํ๋ฐฐ๋ฌ (0) | 2021.04.17 |