結果

問題 No.1238 選抜クラス
ユーザー titia
提出日時 2020-09-25 21:48:13
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 329 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,776 KB
最終ジャッジ日時 2024-06-28 06:22:22
合計ジャッジ時間 26,662 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N,K=map(int,input().split())
A=list(map(int,input().split()))
A=[a-K for a in A]            

DP=[0]*20010
DP[10005]=1

import copy

for a in A:
    NDP=copy.deepcopy(DP)

    for i in range(20010):
        if 0<=i+a<20010:
            NDP[i+a]+=DP[i]

    DP=NDP

print(sum(DP[10005:])-1)
0