結果

問題 No.542 1円玉と5円玉
ユーザー Takuya NoguchiTakuya Noguchi
提出日時 2021-12-12 16:57:46
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 332 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 80,996 KB
最終ジャッジ日時 2023-09-28 09:30:06
合計ジャッジ時間 4,682 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
75,692 KB
testcase_01 AC 77 ms
71,404 KB
testcase_02 AC 78 ms
71,328 KB
testcase_03 AC 79 ms
71,312 KB
testcase_04 AC 86 ms
76,516 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product

A, B = map(int, input().split())
lists = ([1] * A) + ([5] * B)
ans = set()

for bools in product([True, False], repeat = len(lists)):
    tmp = 0

    for i, bool in enumerate(bools):
        if bool: tmp += lists[i]

    if tmp != 0:  ans.add(str(tmp))

print("\n".join(sorted(list(ans), key = int)))
0