結果

問題 No.137 貯金箱の焦り
ユーザー convexineqconvexineq
提出日時 2021-05-14 08:45:00
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 287 bytes
コンパイル時間 519 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 84,536 KB
最終ジャッジ日時 2024-04-08 21:57:04
合計ジャッジ時間 5,987 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
62,752 KB
testcase_01 AC 53 ms
64,032 KB
testcase_02 AC 92 ms
84,204 KB
testcase_03 AC 41 ms
59,952 KB
testcase_04 AC 86 ms
68,444 KB
testcase_05 AC 59 ms
63,264 KB
testcase_06 AC 84 ms
68,188 KB
testcase_07 AC 71 ms
67,740 KB
testcase_08 AC 73 ms
67,868 KB
testcase_09 AC 85 ms
68,444 KB
testcase_10 AC 70 ms
67,740 KB
testcase_11 AC 63 ms
81,476 KB
testcase_12 WA -
testcase_13 AC 96 ms
66,104 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 374 ms
84,252 KB
testcase_17 AC 240 ms
83,996 KB
testcase_18 AC 353 ms
83,996 KB
testcase_19 AC 405 ms
84,192 KB
testcase_20 AC 70 ms
80,852 KB
testcase_21 AC 287 ms
84,252 KB
testcase_22 AC 134 ms
84,344 KB
testcase_23 AC 122 ms
83,804 KB
testcase_24 AC 214 ms
83,612 KB
testcase_25 AC 328 ms
84,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
*a, = map(int,input().split())
MOD = 1234567891
M = 24000
f = [0]*M
f[0] = 1
while m:
    for ai in a:
        for i in range(ai,M)[::-1]:
            f[i] += f[i-ai]
            f[i] %= MOD
    f = f[m%2::2]
    f += [0]*(M-len(f))
    m //= 2
print(f[0])
0