結果

問題 No.1238 選抜クラス
ユーザー NatsubiSoganNatsubiSogan
提出日時 2020-11-07 17:02:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,031 ms / 2,000 ms
コード長 367 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 10,548 KB
実行使用メモリ 30,228 KB
最終ジャッジ日時 2023-09-29 20:39:17
合計ジャッジ時間 24,766 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 154 ms
29,912 KB
testcase_01 AC 159 ms
29,904 KB
testcase_02 AC 205 ms
29,768 KB
testcase_03 AC 138 ms
29,944 KB
testcase_04 AC 139 ms
29,772 KB
testcase_05 AC 138 ms
29,752 KB
testcase_06 AC 137 ms
29,868 KB
testcase_07 AC 172 ms
29,968 KB
testcase_08 AC 201 ms
29,776 KB
testcase_09 AC 243 ms
29,792 KB
testcase_10 AC 188 ms
29,920 KB
testcase_11 AC 223 ms
29,736 KB
testcase_12 AC 206 ms
29,944 KB
testcase_13 AC 211 ms
29,912 KB
testcase_14 AC 202 ms
29,868 KB
testcase_15 AC 249 ms
29,960 KB
testcase_16 AC 240 ms
29,816 KB
testcase_17 AC 930 ms
30,140 KB
testcase_18 AC 941 ms
30,104 KB
testcase_19 AC 915 ms
30,200 KB
testcase_20 AC 911 ms
30,164 KB
testcase_21 AC 927 ms
30,140 KB
testcase_22 AC 947 ms
29,904 KB
testcase_23 AC 920 ms
29,948 KB
testcase_24 AC 934 ms
29,912 KB
testcase_25 AC 977 ms
29,784 KB
testcase_26 AC 998 ms
30,228 KB
testcase_27 AC 1,031 ms
30,108 KB
testcase_28 AC 1,004 ms
30,088 KB
testcase_29 AC 937 ms
30,128 KB
testcase_30 AC 383 ms
29,956 KB
testcase_31 AC 582 ms
30,024 KB
testcase_32 AC 778 ms
30,172 KB
testcase_33 AC 177 ms
29,948 KB
testcase_34 AC 828 ms
30,084 KB
testcase_35 AC 451 ms
29,936 KB
testcase_36 AC 271 ms
29,880 KB
testcase_37 AC 381 ms
29,948 KB
testcase_38 AC 882 ms
30,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
n, k = map(int, input().split())
a = list(map(int, input().split()))
a = list(map(lambda x: x - k, a))
mod = 10 ** 9 + 7
dp = [0] * 20001
dp[10000] = 1
for i in a:
    new = dp[:]
    for j in range(20001):
        if 0 <= i + j <= 20000:
            new[i + j] += dp[j]
            new[i + j] %= mod
    dp = new
print((sum(dp[10000:]) - 1) % mod)
0