結果

問題 No.842 初詣
ユーザー matriematrie
提出日時 2020-12-09 00:46:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 370 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 11,976 KB
実行使用メモリ 10,192 KB
最終ジャッジ日時 2023-10-19 02:26:57
合計ジャッジ時間 1,595 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,192 KB
testcase_01 AC 33 ms
10,192 KB
testcase_02 AC 32 ms
10,192 KB
testcase_03 AC 30 ms
10,192 KB
testcase_04 AC 30 ms
10,192 KB
testcase_05 AC 29 ms
10,192 KB
testcase_06 AC 29 ms
10,192 KB
testcase_07 AC 29 ms
10,192 KB
testcase_08 AC 31 ms
10,192 KB
testcase_09 AC 30 ms
10,192 KB
testcase_10 AC 31 ms
10,192 KB
testcase_11 AC 30 ms
10,192 KB
testcase_12 AC 31 ms
10,192 KB
testcase_13 AC 29 ms
10,192 KB
testcase_14 AC 29 ms
10,192 KB
testcase_15 AC 29 ms
10,192 KB
testcase_16 AC 30 ms
10,192 KB
testcase_17 AC 29 ms
10,192 KB
testcase_18 AC 29 ms
10,192 KB
testcase_19 AC 29 ms
10,192 KB
testcase_20 AC 30 ms
10,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b,c,d,e,f,g = map(int, input().split())
s=500*a+100*b+50*c+10*d+5*e+f
x=1
if g==s: x=0

while g<s:
		y=s-g
		if y>=500 and a>0: s-=500; a-=1
		elif y>=100 and b>0: s-=100; b-=1
		elif y>=50 and c>0: s-=50; c-=1
		elif y>=10 and d>0: s-=10; d-=1
		elif y>=5 and e>0: s-=5; e-=1
		elif y>=1 and f>0: s-=1; f-=1
		else: break
		if g==s: x=0; break

print(["YES","NO"][x])
0