結果

問題 No.542 1円玉と5円玉
ユーザー GrayCoderGrayCoder
提出日時 2017-07-14 22:58:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 403 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 16,256 KB
最終ジャッジ日時 2024-04-16 20:29:10
合計ジャッジ時間 3,805 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
16,256 KB
testcase_01 WA -
testcase_02 AC 31 ms
10,496 KB
testcase_03 AC 30 ms
10,496 KB
testcase_04 AC 57 ms
10,752 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    A, B = map(int, input().split())

    coin = [1] * A
    coin += [5] * B

    ans = []
    price = 0
    mask = 0
    n = A + B
    while mask < (1<<(n)):
        i = 0
        while i < n:
            if mask & (1<<i):
                price += coin[i]
            i += 1
        ans.append(price)
        price = 0
        mask += 1

    for i in set(ans[1:]):
        print(i)

main()
0