結果

問題 No.1238 選抜クラス
ユーザー daikisuyamadaikisuyama
提出日時 2020-09-26 11:33:24
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 444 bytes
コンパイル時間 342 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 92,176 KB
最終ジャッジ日時 2023-09-11 07:28:22
合計ジャッジ時間 6,486 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
76,468 KB
testcase_01 AC 92 ms
76,620 KB
testcase_02 AC 94 ms
77,604 KB
testcase_03 AC 81 ms
75,216 KB
testcase_04 AC 82 ms
75,096 KB
testcase_05 AC 81 ms
75,172 KB
testcase_06 AC 81 ms
75,260 KB
testcase_07 AC 92 ms
77,224 KB
testcase_08 AC 91 ms
77,664 KB
testcase_09 AC 95 ms
78,256 KB
testcase_10 AC 92 ms
77,176 KB
testcase_11 AC 93 ms
78,120 KB
testcase_12 AC 94 ms
77,624 KB
testcase_13 AC 94 ms
77,904 KB
testcase_14 AC 90 ms
77,472 KB
testcase_15 AC 95 ms
78,428 KB
testcase_16 AC 91 ms
78,280 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 136 ms
91,520 KB
testcase_20 WA -
testcase_21 AC 134 ms
90,588 KB
testcase_22 WA -
testcase_23 AC 137 ms
91,844 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 133 ms
91,912 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 100 ms
80,900 KB
testcase_31 WA -
testcase_32 AC 125 ms
88,132 KB
testcase_33 AC 89 ms
77,232 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 102 ms
79,160 KB
testcase_37 WA -
testcase_38 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#k以上だから引けば0以上か
#部分列DPテーブル
mod=10**9+7
n,k=map(int,input().split())
a=[i-k for i in list(map(int,input().split()))]
dp=[[0]*20001 for i in range(n)]
dp[0][a[0]+10000]=1
for i in range(1,n):
    for j in range(20001):
        dp[i][j]=dp[i-1][j]
    dp[i][a[i]+10000]+=1
    for j in range(20001):
        dp[i][j]%=mod
        if j+a[i]<=20000:
            dp[i][j+a[i]]+=dp[i-1][j]
print(sum(dp[-1][10000:]))
0