結果

問題 No.842 初詣
ユーザー convexineqconvexineq
提出日時 2021-02-19 15:39:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 171 ms / 2,000 ms
コード長 233 bytes
コンパイル時間 689 ms
コンパイル使用メモリ 86,952 KB
実行使用メモリ 77,408 KB
最終ジャッジ日時 2023-10-14 09:47:12
合計ジャッジ時間 4,284 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,160 KB
testcase_01 AC 75 ms
71,204 KB
testcase_02 AC 72 ms
71,052 KB
testcase_03 AC 108 ms
77,200 KB
testcase_04 AC 94 ms
76,956 KB
testcase_05 AC 135 ms
77,016 KB
testcase_06 AC 88 ms
76,368 KB
testcase_07 AC 105 ms
76,924 KB
testcase_08 AC 90 ms
76,408 KB
testcase_09 AC 102 ms
77,004 KB
testcase_10 AC 171 ms
77,408 KB
testcase_11 AC 73 ms
71,296 KB
testcase_12 AC 90 ms
76,492 KB
testcase_13 AC 97 ms
76,924 KB
testcase_14 AC 92 ms
76,960 KB
testcase_15 AC 88 ms
76,324 KB
testcase_16 AC 94 ms
77,000 KB
testcase_17 AC 89 ms
76,200 KB
testcase_18 AC 90 ms
76,304 KB
testcase_19 AC 96 ms
76,924 KB
testcase_20 AC 138 ms
77,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

*a,g = map(int,input().split())
from itertools import product
money = [500,100,50,10,5,1]
for lst in product(*(range(ai+1) for ai in a)):
    if sum(i*j for i,j in zip(lst,money)) == g:
        print("YES")
        exit()
print("NO")
0