結果

問題 No.1238 選抜クラス
ユーザー ああいいああいい
提出日時 2022-05-20 11:06:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 393 bytes
コンパイル時間 227 ms
コンパイル使用メモリ 81,824 KB
実行使用メモリ 77,824 KB
最終ジャッジ日時 2023-10-19 22:33:57
合計ジャッジ時間 4,193 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
60,440 KB
testcase_01 AC 49 ms
60,596 KB
testcase_02 AC 50 ms
61,532 KB
testcase_03 AC 46 ms
60,136 KB
testcase_04 AC 46 ms
60,136 KB
testcase_05 AC 46 ms
60,140 KB
testcase_06 AC 46 ms
60,140 KB
testcase_07 AC 49 ms
61,064 KB
testcase_08 AC 50 ms
61,532 KB
testcase_09 AC 54 ms
64,380 KB
testcase_10 AC 51 ms
63,276 KB
testcase_11 AC 53 ms
64,212 KB
testcase_12 AC 51 ms
61,696 KB
testcase_13 AC 52 ms
63,744 KB
testcase_14 AC 50 ms
61,532 KB
testcase_15 AC 52 ms
62,316 KB
testcase_16 AC 52 ms
64,212 KB
testcase_17 AC 75 ms
77,820 KB
testcase_18 AC 76 ms
77,356 KB
testcase_19 AC 73 ms
77,504 KB
testcase_20 AC 73 ms
77,036 KB
testcase_21 AC 73 ms
76,568 KB
testcase_22 AC 71 ms
75,752 KB
testcase_23 AC 74 ms
77,820 KB
testcase_24 AC 72 ms
77,820 KB
testcase_25 AC 71 ms
75,756 KB
testcase_26 AC 74 ms
77,820 KB
testcase_27 AC 73 ms
77,820 KB
testcase_28 AC 76 ms
77,824 KB
testcase_29 AC 75 ms
77,508 KB
testcase_30 AC 57 ms
66,880 KB
testcase_31 AC 63 ms
70,788 KB
testcase_32 AC 68 ms
74,224 KB
testcase_33 AC 49 ms
61,064 KB
testcase_34 AC 73 ms
75,480 KB
testcase_35 AC 60 ms
68,132 KB
testcase_36 AC 53 ms
65,004 KB
testcase_37 AC 57 ms
67,192 KB
testcase_38 AC 74 ms
77,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
A = list(map(int,input().split()))
P = 10 ** 9 + 7

C = 10 ** 4 * 2 + 1
base = 10 ** 4
dat = [0] * C
dat[base] = 1
for a in A:
    nx = dat.copy()
    a -= K
    for i in range(C):
        if 0 <= i + a < C:
            nx[i + a] += dat[i]
            nx[i + a] %= P
    dat = nx
ans = 0
for i in range(base,C):
    ans += dat[i]
    ans %= P
print((ans-1) % P)
0