結果

問題 No.1238 選抜クラス
ユーザー 👑 H20H20
提出日時 2022-01-07 10:07:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 398 ms / 2,000 ms
コード長 410 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 96,000 KB
最終ジャッジ日時 2024-04-26 06:49:52
合計ジャッジ時間 6,761 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
53,760 KB
testcase_01 AC 41 ms
53,760 KB
testcase_02 AC 43 ms
54,016 KB
testcase_03 AC 42 ms
53,888 KB
testcase_04 AC 42 ms
53,760 KB
testcase_05 AC 42 ms
53,504 KB
testcase_06 AC 42 ms
53,632 KB
testcase_07 AC 42 ms
54,016 KB
testcase_08 AC 43 ms
54,272 KB
testcase_09 AC 53 ms
63,232 KB
testcase_10 AC 42 ms
54,016 KB
testcase_11 AC 51 ms
63,104 KB
testcase_12 AC 44 ms
54,704 KB
testcase_13 AC 44 ms
54,144 KB
testcase_14 AC 43 ms
54,400 KB
testcase_15 AC 55 ms
64,256 KB
testcase_16 AC 53 ms
63,232 KB
testcase_17 AC 325 ms
96,000 KB
testcase_18 AC 322 ms
96,000 KB
testcase_19 AC 398 ms
95,744 KB
testcase_20 AC 332 ms
90,124 KB
testcase_21 AC 272 ms
88,960 KB
testcase_22 AC 51 ms
62,592 KB
testcase_23 AC 51 ms
62,976 KB
testcase_24 AC 51 ms
62,848 KB
testcase_25 AC 53 ms
63,104 KB
testcase_26 AC 301 ms
92,864 KB
testcase_27 AC 311 ms
92,800 KB
testcase_28 AC 331 ms
94,392 KB
testcase_29 AC 366 ms
89,728 KB
testcase_30 AC 65 ms
67,840 KB
testcase_31 AC 117 ms
77,760 KB
testcase_32 AC 180 ms
80,384 KB
testcase_33 AC 47 ms
54,136 KB
testcase_34 AC 262 ms
84,608 KB
testcase_35 AC 76 ms
72,192 KB
testcase_36 AC 58 ms
64,000 KB
testcase_37 AC 63 ms
68,992 KB
testcase_38 AC 280 ms
89,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
N,K = map(int,input().split())
A = list(map(int,input().split()))
mod = 10**9+7
DP = [collections.defaultdict(int) for _ in range(N+1)]
DP[0][0]=1
for a in A:
    for i in reversed(range(N)):
        for k,v in DP[i].items():
            DP[i+1][k+a] = (DP[i+1][k+a]+v) % mod
ans = 0
for i in range(1,N+1):
    for k,v in DP[i].items():
        if k>=K*i:
            ans+=v
print(ans%mod)

0