結果

問題 No.1238 選抜クラス
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2020-09-25 23:36:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 809 ms / 2,000 ms
コード長 357 bytes
コンパイル時間 366 ms
コンパイル使用メモリ 10,900 KB
実行使用メモリ 33,280 KB
最終ジャッジ日時 2023-09-10 17:10:50
合計ジャッジ時間 15,221 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
8,760 KB
testcase_01 AC 34 ms
8,856 KB
testcase_02 AC 72 ms
9,868 KB
testcase_03 AC 22 ms
8,564 KB
testcase_04 AC 22 ms
8,540 KB
testcase_05 AC 21 ms
8,544 KB
testcase_06 AC 23 ms
8,492 KB
testcase_07 AC 54 ms
9,344 KB
testcase_08 AC 76 ms
9,816 KB
testcase_09 AC 106 ms
10,576 KB
testcase_10 AC 61 ms
9,504 KB
testcase_11 AC 99 ms
10,496 KB
testcase_12 AC 82 ms
10,048 KB
testcase_13 AC 81 ms
10,012 KB
testcase_14 AC 74 ms
9,764 KB
testcase_15 AC 104 ms
10,616 KB
testcase_16 AC 98 ms
10,584 KB
testcase_17 AC 743 ms
30,872 KB
testcase_18 AC 695 ms
27,576 KB
testcase_19 AC 773 ms
31,540 KB
testcase_20 AC 733 ms
30,524 KB
testcase_21 AC 703 ms
28,688 KB
testcase_22 AC 644 ms
24,460 KB
testcase_23 AC 652 ms
24,596 KB
testcase_24 AC 662 ms
24,596 KB
testcase_25 AC 659 ms
24,316 KB
testcase_26 AC 735 ms
31,360 KB
testcase_27 AC 809 ms
33,280 KB
testcase_28 AC 733 ms
28,860 KB
testcase_29 AC 720 ms
27,992 KB
testcase_30 AC 209 ms
13,316 KB
testcase_31 AC 387 ms
18,452 KB
testcase_32 AC 569 ms
24,488 KB
testcase_33 AC 54 ms
9,260 KB
testcase_34 AC 605 ms
24,888 KB
testcase_35 AC 265 ms
14,840 KB
testcase_36 AC 133 ms
11,200 KB
testcase_37 AC 227 ms
13,940 KB
testcase_38 AC 689 ms
27,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

print((sum(dp[-1][10000:])-1)%mod)
0