結果

問題 No.842 初詣
ユーザー hiragnhiragn
提出日時 2022-11-12 22:52:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 404 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 10,688 KB
実行使用メモリ 8,312 KB
最終ジャッジ日時 2023-10-12 12:06:44
合計ジャッジ時間 1,494 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,236 KB
testcase_01 AC 15 ms
8,088 KB
testcase_02 AC 16 ms
8,116 KB
testcase_03 AC 24 ms
8,108 KB
testcase_04 AC 20 ms
8,236 KB
testcase_05 AC 43 ms
8,084 KB
testcase_06 AC 16 ms
8,272 KB
testcase_07 AC 26 ms
8,088 KB
testcase_08 AC 15 ms
8,276 KB
testcase_09 AC 23 ms
8,092 KB
testcase_10 AC 68 ms
8,256 KB
testcase_11 AC 15 ms
8,208 KB
testcase_12 AC 16 ms
8,132 KB
testcase_13 AC 20 ms
8,312 KB
testcase_14 AC 20 ms
8,236 KB
testcase_15 AC 15 ms
8,268 KB
testcase_16 AC 18 ms
8,212 KB
testcase_17 AC 16 ms
8,136 KB
testcase_18 AC 16 ms
8,128 KB
testcase_19 AC 20 ms
8,148 KB
testcase_20 AC 45 ms
8,196 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools


def main():
    a, b, c, d, e, f, g = map(int, input().split())
    for aa, bb, cc, dd, ee, ff in itertools.product(
            range(a + 1), range(b + 1), range(c + 1), range(d + 1), range(e + 1), range(f + 1)):
        if 500 * aa + 100 * bb + 50 * cc + 10 * dd + 5 * ee + ff == g:
            print("YES")
            exit()
    print("NO")


if __name__ == "__main__":
    main()
0