結果

問題 No.842 初詣
ユーザー stngstng
提出日時 2022-07-16 15:59:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 198 bytes
コンパイル時間 405 ms
コンパイル使用メモリ 87,344 KB
実行使用メモリ 71,640 KB
最終ジャッジ日時 2023-09-11 00:58:01
合計ジャッジ時間 3,129 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,640 KB
testcase_01 AC 69 ms
71,432 KB
testcase_02 AC 69 ms
71,508 KB
testcase_03 AC 68 ms
71,400 KB
testcase_04 AC 74 ms
71,296 KB
testcase_05 AC 69 ms
71,148 KB
testcase_06 AC 67 ms
71,568 KB
testcase_07 AC 70 ms
71,136 KB
testcase_08 AC 70 ms
71,452 KB
testcase_09 AC 68 ms
71,268 KB
testcase_10 AC 71 ms
71,568 KB
testcase_11 AC 69 ms
71,336 KB
testcase_12 AC 68 ms
71,396 KB
testcase_13 AC 69 ms
71,580 KB
testcase_14 AC 71 ms
71,156 KB
testcase_15 AC 69 ms
71,472 KB
testcase_16 AC 68 ms
71,520 KB
testcase_17 AC 68 ms
71,144 KB
testcase_18 AC 70 ms
71,376 KB
testcase_19 AC 69 ms
71,112 KB
testcase_20 AC 69 ms
71,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a = [int(i) for i in input().split()]

g = a[6]
z = [500,100,50,10,5,1]

for i in range(6):
    if z[i] <= g:
        g -= min((g//z[i]),a[i])*z[i]
if g == 0:
    print("YES")
else:
    print("NO")
0