結果

問題 No.1238 選抜クラス
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2020-09-25 23:38:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 561 ms / 2,000 ms
コード長 341 bytes
コンパイル時間 116 ms
コンパイル使用メモリ 10,524 KB
実行使用メモリ 8,748 KB
最終ジャッジ日時 2023-09-10 17:11:45
合計ジャッジ時間 11,373 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
8,248 KB
testcase_01 AC 31 ms
8,248 KB
testcase_02 AC 65 ms
8,244 KB
testcase_03 AC 23 ms
8,408 KB
testcase_04 AC 22 ms
8,300 KB
testcase_05 AC 21 ms
8,208 KB
testcase_06 AC 21 ms
8,252 KB
testcase_07 AC 45 ms
8,288 KB
testcase_08 AC 56 ms
8,248 KB
testcase_09 AC 81 ms
8,300 KB
testcase_10 AC 49 ms
8,328 KB
testcase_11 AC 74 ms
8,248 KB
testcase_12 AC 61 ms
8,400 KB
testcase_13 AC 62 ms
8,288 KB
testcase_14 AC 60 ms
8,380 KB
testcase_15 AC 81 ms
8,352 KB
testcase_16 AC 75 ms
8,208 KB
testcase_17 AC 523 ms
8,640 KB
testcase_18 AC 495 ms
8,612 KB
testcase_19 AC 561 ms
8,516 KB
testcase_20 AC 519 ms
8,604 KB
testcase_21 AC 486 ms
8,564 KB
testcase_22 AC 482 ms
8,372 KB
testcase_23 AC 468 ms
8,288 KB
testcase_24 AC 467 ms
8,348 KB
testcase_25 AC 474 ms
8,260 KB
testcase_26 AC 547 ms
8,748 KB
testcase_27 AC 560 ms
8,556 KB
testcase_28 AC 521 ms
8,616 KB
testcase_29 AC 515 ms
8,636 KB
testcase_30 AC 153 ms
8,352 KB
testcase_31 AC 280 ms
8,632 KB
testcase_32 AC 409 ms
8,500 KB
testcase_33 AC 43 ms
8,284 KB
testcase_34 AC 442 ms
8,596 KB
testcase_35 AC 189 ms
8,224 KB
testcase_36 AC 97 ms
8,388 KB
testcase_37 AC 161 ms
8,280 KB
testcase_38 AC 480 ms
8,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
a = list(map(int,input().split()))
dp = [0]*(20001)
dp[10000] = 1
mod = 10**9+7
for i in range(n):
    x = a[i]-k
    ndp = [0]*(20001)
    for j in range(20001):
        if dp[j] > 0:
            ndp[j+x] += dp[j]
            ndp[j+x] %= mod
        ndp[j] += dp[j]
    dp = ndp
print((sum(dp[10000:])-1)%mod)
0