結果

問題 No.1238 選抜クラス
ユーザー roarisroaris
提出日時 2020-11-18 16:14:02
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 671 bytes
コンパイル時間 604 ms
コンパイル使用メモリ 87,356 KB
実行使用メモリ 77,056 KB
最終ジャッジ日時 2023-09-30 15:04:18
合計ジャッジ時間 6,391 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
76,868 KB
testcase_01 AC 94 ms
76,900 KB
testcase_02 AC 126 ms
76,844 KB
testcase_03 AC 83 ms
76,260 KB
testcase_04 AC 83 ms
76,236 KB
testcase_05 AC 83 ms
76,356 KB
testcase_06 AC 83 ms
76,276 KB
testcase_07 AC 111 ms
76,916 KB
testcase_08 AC 131 ms
76,852 KB
testcase_09 AC 167 ms
76,864 KB
testcase_10 AC 114 ms
77,056 KB
testcase_11 AC 160 ms
76,916 KB
testcase_12 AC 133 ms
76,864 KB
testcase_13 AC 134 ms
76,952 KB
testcase_14 AC 126 ms
76,916 KB
testcase_15 AC 169 ms
77,036 KB
testcase_16 AC 165 ms
76,904 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]*10001 for _ in range(N+1)] for _ in range(2)]
dp[0][0][0] = 1
MOD = 10**9+7

for i in range(N):
    for j in range(N+1):
        for k in range(10001):
            dp[(i+1)%2][j][k] = 0
            
    for j in range(N+1):
        for k in range(10001):
            dp[(i+1)%2][j][k] = (dp[(i+1)%2][j][k]+dp[i%2][j][k])%MOD
            
            if j+1<=N and k+A[i]<=10000:
                dp[(i+1)%2][j+1][k+A[i]] = (dp[(i+1)%2][j+1][k+A[i]]+dp[i%2][j][k])%MOD

tle = 0

for i in range(1, N+1):
    for j in range(10001):
        if j>=i*K:
            tle += dp[N%2][i][j]

print(tle)
0