結果

問題 No.1238 選抜クラス
ユーザー daikisuyamadaikisuyama
提出日時 2020-09-26 11:38:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 451 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 91,984 KB
最終ジャッジ日時 2023-09-11 07:33:36
合計ジャッジ時間 6,397 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
76,452 KB
testcase_01 AC 90 ms
76,684 KB
testcase_02 AC 93 ms
77,760 KB
testcase_03 AC 80 ms
75,260 KB
testcase_04 AC 80 ms
75,188 KB
testcase_05 AC 82 ms
75,192 KB
testcase_06 AC 80 ms
75,196 KB
testcase_07 AC 92 ms
77,212 KB
testcase_08 AC 93 ms
77,704 KB
testcase_09 AC 98 ms
78,472 KB
testcase_10 AC 94 ms
77,136 KB
testcase_11 AC 95 ms
78,088 KB
testcase_12 AC 93 ms
77,784 KB
testcase_13 AC 96 ms
77,604 KB
testcase_14 AC 91 ms
77,444 KB
testcase_15 AC 95 ms
78,532 KB
testcase_16 AC 96 ms
78,244 KB
testcase_17 AC 141 ms
91,712 KB
testcase_18 AC 139 ms
91,232 KB
testcase_19 AC 137 ms
91,536 KB
testcase_20 AC 139 ms
91,080 KB
testcase_21 AC 135 ms
90,444 KB
testcase_22 AC 138 ms
91,624 KB
testcase_23 AC 140 ms
91,836 KB
testcase_24 AC 138 ms
91,956 KB
testcase_25 AC 138 ms
91,880 KB
testcase_26 AC 140 ms
91,924 KB
testcase_27 AC 137 ms
91,948 KB
testcase_28 AC 139 ms
91,984 KB
testcase_29 AC 138 ms
91,604 KB
testcase_30 AC 101 ms
80,744 KB
testcase_31 AC 118 ms
84,916 KB
testcase_32 AC 128 ms
88,272 KB
testcase_33 AC 90 ms
77,300 KB
testcase_34 AC 132 ms
89,508 KB
testcase_35 AC 109 ms
82,216 KB
testcase_36 AC 99 ms
79,100 KB
testcase_37 AC 107 ms
81,356 KB
testcase_38 AC 138 ms
91,272 KB
権限があれば一括ダウンロードができます

ソースコード

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:])%mod)
0