結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
66,768 KB
testcase_01 AC 62 ms
68,864 KB
testcase_02 AC 98 ms
83,476 KB
testcase_03 AC 45 ms
62,060 KB
testcase_04 AC 46 ms
62,060 KB
testcase_05 AC 45 ms
62,056 KB
testcase_06 AC 45 ms
62,060 KB
testcase_07 AC 78 ms
73,212 KB
testcase_08 AC 102 ms
83,380 KB
testcase_09 AC 148 ms
93,428 KB
testcase_10 AC 91 ms
80,732 KB
testcase_11 AC 146 ms
91,340 KB
testcase_12 AC 106 ms
85,144 KB
testcase_13 AC 113 ms
85,084 KB
testcase_14 AC 102 ms
83,476 KB
testcase_15 AC 152 ms
93,476 KB
testcase_16 AC 136 ms
91,332 KB
testcase_17 MLE -
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()))

mod = 10**9+7
dp = [[[0]*10001 for _ in range(N+1)] for _ in range(N+1)]
dp[0][0][0] = 1
res = 0
for i in range(1, N+1):
    for j in range(N+1):
        for k in range(10001):
            dp[i][j][k] += dp[i-1][j][k]
            dp[i][j][k] %= mod
            if j > 0 and k+A[i-1] <= 10000:
                dp[i][j][k+A[i-1]] += dp[i-1][j-1][k]
                dp[i][j][k+A[i-1]] %= mod
            if i == N and j > 0 and k >= j*K:
                res += dp[i][j][k]
                res %= mod

print(res)
0