結果

問題 No.842 初詣
ユーザー bellangeldindonbellangeldindon
提出日時 2019-06-28 21:54:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 104 ms / 2,000 ms
コード長 326 bytes
コンパイル時間 597 ms
コンパイル使用メモリ 87,024 KB
実行使用メモリ 105,296 KB
最終ジャッジ日時 2023-09-14 21:55:30
合計ジャッジ時間 3,342 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,308 KB
testcase_01 AC 75 ms
71,336 KB
testcase_02 AC 74 ms
71,172 KB
testcase_03 AC 82 ms
78,460 KB
testcase_04 AC 80 ms
76,760 KB
testcase_05 AC 90 ms
86,616 KB
testcase_06 AC 80 ms
76,132 KB
testcase_07 AC 85 ms
78,716 KB
testcase_08 AC 79 ms
76,136 KB
testcase_09 AC 83 ms
78,084 KB
testcase_10 AC 104 ms
105,296 KB
testcase_11 AC 76 ms
71,244 KB
testcase_12 AC 86 ms
80,044 KB
testcase_13 AC 82 ms
76,984 KB
testcase_14 AC 83 ms
76,372 KB
testcase_15 AC 81 ms
76,292 KB
testcase_16 AC 82 ms
76,264 KB
testcase_17 AC 85 ms
78,408 KB
testcase_18 AC 92 ms
85,500 KB
testcase_19 AC 86 ms
77,328 KB
testcase_20 AC 91 ms
85,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

coins = [500, 100, 50, 10, 5, 1]
A, B, C, D, E, F, G = map(int, input().split())
coinamount = [A, B, C, D, E, F]
totallist = [0]
for i in range(0, 6):
	N = len(totallist)
	for j in range(0, N):
		for k in range(1, coinamount[i]+1):
			totallist.append(totallist[j]+coins[i]*k)
if G in totallist: print('YES')
else: print('NO')
0