結果

問題 No.1238 選抜クラス
ユーザー ibyiby
提出日時 2020-11-27 01:16:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 327 ms / 2,000 ms
コード長 437 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 10,952 KB
実行使用メモリ 51,708 KB
最終ジャッジ日時 2023-10-01 03:44:00
合計ジャッジ時間 8,537 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
42,860 KB
testcase_01 AC 61 ms
42,916 KB
testcase_02 AC 76 ms
42,840 KB
testcase_03 AC 55 ms
42,792 KB
testcase_04 AC 55 ms
42,924 KB
testcase_05 AC 55 ms
42,920 KB
testcase_06 AC 55 ms
42,840 KB
testcase_07 AC 72 ms
42,772 KB
testcase_08 AC 75 ms
42,792 KB
testcase_09 AC 88 ms
42,892 KB
testcase_10 AC 71 ms
42,744 KB
testcase_11 AC 86 ms
42,848 KB
testcase_12 AC 77 ms
42,968 KB
testcase_13 AC 78 ms
42,844 KB
testcase_14 AC 76 ms
42,708 KB
testcase_15 AC 88 ms
42,744 KB
testcase_16 AC 85 ms
42,844 KB
testcase_17 AC 319 ms
47,840 KB
testcase_18 AC 307 ms
46,296 KB
testcase_19 AC 319 ms
50,328 KB
testcase_20 AC 306 ms
48,304 KB
testcase_21 AC 299 ms
48,488 KB
testcase_22 AC 304 ms
42,792 KB
testcase_23 AC 308 ms
42,784 KB
testcase_24 AC 309 ms
42,944 KB
testcase_25 AC 305 ms
42,704 KB
testcase_26 AC 319 ms
47,720 KB
testcase_27 AC 327 ms
51,708 KB
testcase_28 AC 317 ms
47,252 KB
testcase_29 AC 311 ms
46,504 KB
testcase_30 AC 129 ms
42,920 KB
testcase_31 AC 195 ms
43,820 KB
testcase_32 AC 256 ms
46,572 KB
testcase_33 AC 68 ms
42,776 KB
testcase_34 AC 276 ms
45,480 KB
testcase_35 AC 150 ms
43,184 KB
testcase_36 AC 98 ms
42,776 KB
testcase_37 AC 135 ms
43,188 KB
testcase_38 AC 304 ms
46,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10**9 + 7


def solve():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    dp = [[0]*(40010) for i in range(110)]
    dp[0][10000] = 1
    for i, score in enumerate(a):
        v = score - k
        for j in range(20010):
            dp[i + 1][j] = (dp[i][j] + dp[i][j - v]) % MOD
    ans = sum(dp[n][s] for s in range(10000, 20010)) % MOD
    ans = (ans - 1)%MOD
    print(ans)
    return


solve()
0