結果

問題 No.1238 選抜クラス
ユーザー daikisuyamadaikisuyama
提出日時 2020-09-26 11:35:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 447 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 91,992 KB
最終ジャッジ日時 2023-09-11 07:30:10
合計ジャッジ時間 6,271 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
76,436 KB
testcase_01 AC 89 ms
76,516 KB
testcase_02 AC 93 ms
77,684 KB
testcase_03 AC 79 ms
75,292 KB
testcase_04 AC 81 ms
75,116 KB
testcase_05 AC 79 ms
75,096 KB
testcase_06 AC 79 ms
74,992 KB
testcase_07 AC 87 ms
77,132 KB
testcase_08 AC 92 ms
77,552 KB
testcase_09 AC 95 ms
78,592 KB
testcase_10 AC 91 ms
77,304 KB
testcase_11 AC 93 ms
78,304 KB
testcase_12 AC 94 ms
77,840 KB
testcase_13 AC 93 ms
77,708 KB
testcase_14 AC 91 ms
77,752 KB
testcase_15 AC 94 ms
78,420 KB
testcase_16 AC 94 ms
78,168 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 138 ms
91,408 KB
testcase_20 WA -
testcase_21 AC 135 ms
90,748 KB
testcase_22 WA -
testcase_23 AC 139 ms
91,916 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 136 ms
91,876 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 103 ms
80,976 KB
testcase_31 WA -
testcase_32 AC 125 ms
88,016 KB
testcase_33 AC 90 ms
76,964 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 97 ms
79,064 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 0<=j+a[i]<=20000:
            dp[i][j+a[i]]+=dp[i-1][j]
print(sum(dp[-1][10000:]))
0