[알고리즘 문제풀이] 거스름돈

황인권·2023년 4월 13일
0

알고리즘 문제풀이

목록 보기
44/81

문제 제목 : 거스름돈

문제 난이도 : 하

문제 유형 : 그리디, 탐욕 알고리즘

https://www.acmicpc.net/problem/5585
시간 제한 : 1초
메모리 제한 : 128MB

문제풀이 아이디어

< 소스코드 >

chansges = 1000 - int(input())
count = 0

for i in [500, 100, 50, 10, 5, 1]:
    count += chansges // i
    chansges = chansges % i
    
print(count)
profile
inkwon Hwang

0개의 댓글