結果
| 問題 | No.842 初詣 | 
| コンテスト | |
| ユーザー |  convexineq | 
| 提出日時 | 2021-02-19 15:39:37 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 129 ms / 2,000 ms | 
| コード長 | 233 bytes | 
| コンパイル時間 | 434 ms | 
| コンパイル使用メモリ | 82,432 KB | 
| 実行使用メモリ | 75,776 KB | 
| 最終ジャッジ日時 | 2024-09-16 04:45:25 | 
| 合計ジャッジ時間 | 2,611 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 21 | 
ソースコード
*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")
            
            
            
        