結果

問題 No.1238 選抜クラス
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2020-09-25 23:11:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 604 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 10,916 KB
実行使用メモリ 8,532 KB
最終ジャッジ日時 2023-09-10 16:12:30
合計ジャッジ時間 4,851 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,936 KB
testcase_01 AC 17 ms
7,792 KB
testcase_02 AC 31 ms
8,244 KB
testcase_03 AC 16 ms
7,796 KB
testcase_04 AC 16 ms
7,860 KB
testcase_05 AC 16 ms
7,764 KB
testcase_06 AC 16 ms
7,692 KB
testcase_07 AC 22 ms
8,344 KB
testcase_08 AC 31 ms
8,272 KB
testcase_09 AC 71 ms
8,504 KB
testcase_10 AC 24 ms
8,228 KB
testcase_11 AC 59 ms
8,516 KB
testcase_12 AC 36 ms
8,408 KB
testcase_13 AC 39 ms
8,332 KB
testcase_14 AC 31 ms
8,412 KB
testcase_15 AC 67 ms
8,532 KB
testcase_16 AC 61 ms
8,528 KB
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,K = map(int,input().split())
a = list(map(int,input().split()))
dp = [[0]*(101) for i in range(2)]
dp[0][0] = 1
mod = 10**9+7

for i in range(n):
    ndp = [[0]*(100*(i+2)+1) for x in range(i+2)]
    for j in range(i+1):
        x = a[i]
        for k in range(100*(i+1)+1):
            if dp[j][k] > 0:
                ndp[j+1][k+x] += dp[j][k]
                ndp[j+1][k+x] %= mod
            ndp[j][k] += dp[j][k]
            ndp[j][k] %= mod
    dp = ndp
ans = 0
for i in range(1,n+1):
    for j in range(100*n+1):
        if i*K <= j:
            ans += dp[i][j]
            ans %= mod
print(ans)
0