結果

問題 No.1238 選抜クラス
ユーザー AEnAEn
提出日時 2022-05-22 11:59:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 402 bytes
コンパイル時間 652 ms
コンパイル使用メモリ 81,840 KB
実行使用メモリ 79,580 KB
最終ジャッジ日時 2023-10-20 16:55:44
合計ジャッジ時間 4,462 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
60,088 KB
testcase_01 AC 45 ms
62,344 KB
testcase_02 AC 47 ms
63,280 KB
testcase_03 AC 38 ms
56,816 KB
testcase_04 AC 35 ms
56,816 KB
testcase_05 AC 36 ms
56,816 KB
testcase_06 AC 35 ms
56,816 KB
testcase_07 AC 45 ms
62,812 KB
testcase_08 AC 49 ms
63,280 KB
testcase_09 AC 51 ms
64,076 KB
testcase_10 AC 46 ms
62,984 KB
testcase_11 AC 51 ms
63,920 KB
testcase_12 AC 48 ms
63,452 KB
testcase_13 AC 48 ms
63,452 KB
testcase_14 AC 47 ms
63,280 KB
testcase_15 AC 54 ms
64,060 KB
testcase_16 AC 50 ms
63,920 KB
testcase_17 AC 95 ms
79,576 KB
testcase_18 AC 96 ms
79,116 KB
testcase_19 AC 92 ms
77,216 KB
testcase_20 AC 93 ms
78,796 KB
testcase_21 AC 95 ms
78,324 KB
testcase_22 AC 91 ms
77,448 KB
testcase_23 AC 94 ms
77,528 KB
testcase_24 AC 90 ms
79,512 KB
testcase_25 AC 96 ms
77,512 KB
testcase_26 AC 91 ms
79,512 KB
testcase_27 AC 94 ms
77,528 KB
testcase_28 AC 97 ms
79,580 KB
testcase_29 AC 94 ms
79,268 KB
testcase_30 AC 60 ms
66,580 KB
testcase_31 AC 72 ms
72,540 KB
testcase_32 AC 80 ms
73,924 KB
testcase_33 AC 47 ms
62,812 KB
testcase_34 AC 86 ms
77,236 KB
testcase_35 AC 66 ms
69,884 KB
testcase_36 AC 54 ms
64,704 KB
testcase_37 AC 60 ms
66,892 KB
testcase_38 AC 88 ms
78,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
a = list(map(int,input().split()))
mod = 10**9+7
dp = [[0]*20001 for _ in range(N)]
dp[0][a[0]-K+10000] = 1
for i in range(1,N):
    for j in range(20001):
        dp[i][j] = dp[i-1][j]
    dp[i][a[i]-K+10000] += 1
    for j in range(20001):
        dp[i][j] %= mod
        if 0<=j+a[i]-K<=20000:
            dp[i][j+a[i]-K] += dp[i-1][j]
print(sum(dp[-1][10000:])%mod)
0