白駿5585号Python
グレースケールアルゴリズム
n=int(input())
n=1000-n
result=0
while 1:
if n==0 :
print(result)
break
if n >=500 :
temp=n//500
result+=temp
n-=temp*500
elif n>=100 and n<500:
temp=n//100
result+=temp
n-=temp*100
elif n>=50 and n<100:
temp=n//50
result+=temp
n-=temp*50
elif n>=10 and n<50 :
temp=n//10
result+=temp
n-=temp*10
elif n>=5 and n<10 :
temp=n//5
result+=temp
n-=temp*5
else :
result+=n
n=0
Reference
この問題について(白駿5585号Python), 我々は、より多くの情報をここで見つけました https://velog.io/@onenewarm/백준-5585번-pythonテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol