結果

問題 No.1238 選抜クラス
ユーザー H3PO4H3PO4
提出日時 2020-09-25 21:55:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 298 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 10,644 KB
実行使用メモリ 30,136 KB
最終ジャッジ日時 2023-09-10 15:23:30
合計ジャッジ時間 8,331 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
29,948 KB
testcase_01 AC 134 ms
30,040 KB
testcase_02 AC 134 ms
29,920 KB
testcase_03 RE -
testcase_04 AC 134 ms
29,948 KB
testcase_05 AC 133 ms
29,792 KB
testcase_06 RE -
testcase_07 AC 134 ms
29,952 KB
testcase_08 AC 140 ms
30,020 KB
testcase_09 AC 137 ms
29,976 KB
testcase_10 AC 138 ms
29,980 KB
testcase_11 AC 140 ms
29,936 KB
testcase_12 AC 136 ms
30,048 KB
testcase_13 AC 138 ms
30,048 KB
testcase_14 AC 134 ms
29,952 KB
testcase_15 AC 140 ms
29,936 KB
testcase_16 AC 136 ms
29,952 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 162 ms
29,892 KB
testcase_24 WA -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 AC 140 ms
29,916 KB
testcase_31 WA -
testcase_32 AC 155 ms
30,020 KB
testcase_33 AC 133 ms
29,848 KB
testcase_34 RE -
testcase_35 WA -
testcase_36 AC 136 ms
29,952 KB
testcase_37 WA -
testcase_38 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

N, K = map(int, input().split())
A = [int(x) - K for x in input().split()]

MOD = 10 ** 9 + 7
L = 10000
dp = np.zeros(2 * L + 1, dtype=int)
dp[L] = 1

for a in A:
    if a >= 0:
        dp[a:] += dp[:-a]
    else:
        dp[:a] += dp[-a:]
    dp %= MOD
print(dp[L:].sum() - 1)
0