結果

問題 No.1238 選抜クラス
ユーザー titiatitia
提出日時 2020-09-25 21:50:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,199 ms / 2,000 ms
コード長 341 bytes
コンパイル時間 175 ms
コンパイル使用メモリ 10,716 KB
実行使用メモリ 9,220 KB
最終ジャッジ日時 2023-09-10 15:16:06
合計ジャッジ時間 24,469 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
8,636 KB
testcase_01 AC 54 ms
8,756 KB
testcase_02 AC 123 ms
8,664 KB
testcase_03 AC 31 ms
8,540 KB
testcase_04 AC 31 ms
8,544 KB
testcase_05 AC 31 ms
8,540 KB
testcase_06 AC 31 ms
8,512 KB
testcase_07 AC 87 ms
8,740 KB
testcase_08 AC 125 ms
8,596 KB
testcase_09 AC 179 ms
8,760 KB
testcase_10 AC 100 ms
8,752 KB
testcase_11 AC 171 ms
8,752 KB
testcase_12 AC 136 ms
8,680 KB
testcase_13 AC 134 ms
8,772 KB
testcase_14 AC 125 ms
8,624 KB
testcase_15 AC 181 ms
8,664 KB
testcase_16 AC 170 ms
8,628 KB
testcase_17 AC 1,185 ms
8,944 KB
testcase_18 AC 1,148 ms
8,936 KB
testcase_19 AC 1,154 ms
9,088 KB
testcase_20 AC 1,193 ms
8,940 KB
testcase_21 AC 1,107 ms
9,060 KB
testcase_22 AC 1,174 ms
8,736 KB
testcase_23 AC 1,154 ms
8,632 KB
testcase_24 AC 1,183 ms
8,620 KB
testcase_25 AC 1,160 ms
8,628 KB
testcase_26 AC 1,199 ms
9,220 KB
testcase_27 AC 1,194 ms
9,140 KB
testcase_28 AC 1,171 ms
8,960 KB
testcase_29 AC 1,139 ms
8,936 KB
testcase_30 AC 363 ms
8,660 KB
testcase_31 AC 668 ms
8,840 KB
testcase_32 AC 945 ms
8,948 KB
testcase_33 AC 88 ms
8,680 KB
testcase_34 AC 1,004 ms
8,880 KB
testcase_35 AC 455 ms
8,668 KB
testcase_36 AC 226 ms
8,756 KB
testcase_37 AC 405 ms
8,684 KB
testcase_38 AC 1,107 ms
9,016 KB
権限があれば一括ダウンロードができます

ソースコード

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)%(10**9+7))
0