結果

問題 No.842 初詣
ユーザー GrayCoderGrayCoder
提出日時 2019-06-28 22:05:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 204 ms / 2,000 ms
コード長 519 bytes
コンパイル時間 624 ms
コンパイル使用メモリ 10,784 KB
実行使用メモリ 8,308 KB
最終ジャッジ日時 2023-09-14 22:01:09
合計ジャッジ時間 4,077 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,112 KB
testcase_01 AC 17 ms
8,300 KB
testcase_02 AC 187 ms
8,216 KB
testcase_03 AC 133 ms
8,200 KB
testcase_04 AC 130 ms
8,192 KB
testcase_05 AC 172 ms
8,132 KB
testcase_06 AC 199 ms
8,232 KB
testcase_07 AC 198 ms
8,132 KB
testcase_08 AC 202 ms
8,296 KB
testcase_09 AC 155 ms
8,208 KB
testcase_10 AC 125 ms
8,296 KB
testcase_11 AC 185 ms
8,188 KB
testcase_12 AC 20 ms
8,148 KB
testcase_13 AC 133 ms
8,216 KB
testcase_14 AC 204 ms
8,152 KB
testcase_15 AC 204 ms
8,260 KB
testcase_16 AC 203 ms
8,140 KB
testcase_17 AC 31 ms
8,244 KB
testcase_18 AC 20 ms
8,128 KB
testcase_19 AC 133 ms
8,244 KB
testcase_20 AC 204 ms
8,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product
from sys import stdin

def main():
    A, B, C, D, E, F, G = map(int, input().split())

    for a, b, c, d, e in product(range(11), repeat=5):
        money = min(a, A) * 500
        money += min(b, B) * 100
        money += min(c, C) * 50
        money += min(d, D) * 10
        money += min(e, E) * 5
        if G < money:
            continue
        elif G - money <= F:
            print('YES')
            break
    else:
        print('NO')

input = lambda: stdin.readline()
main()
0