結果

問題 No.1238 選抜クラス
ユーザー 👑 platinumplatinum
提出日時 2020-09-08 00:00:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 417 bytes
コンパイル時間 116 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 36,480 KB
最終ジャッジ日時 2024-05-07 00:22:26
合計ジャッジ時間 37,509 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 170 ms
27,520 KB
testcase_01 AC 184 ms
27,648 KB
testcase_02 AC 272 ms
27,520 KB
testcase_03 AC 147 ms
27,648 KB
testcase_04 AC 149 ms
27,520 KB
testcase_05 AC 148 ms
27,520 KB
testcase_06 AC 150 ms
27,520 KB
testcase_07 AC 233 ms
27,648 KB
testcase_08 AC 275 ms
27,648 KB
testcase_09 AC 359 ms
27,648 KB
testcase_10 AC 248 ms
27,520 KB
testcase_11 AC 337 ms
27,648 KB
testcase_12 AC 294 ms
27,648 KB
testcase_13 AC 286 ms
27,648 KB
testcase_14 AC 271 ms
27,648 KB
testcase_15 AC 355 ms
27,520 KB
testcase_16 AC 344 ms
27,520 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 1,713 ms
35,072 KB
testcase_20 WA -
testcase_21 AC 1,644 ms
33,152 KB
testcase_22 AC 1,735 ms
27,648 KB
testcase_23 AC 1,767 ms
27,776 KB
testcase_24 WA -
testcase_25 AC 1,788 ms
27,648 KB
testcase_26 WA -
testcase_27 AC 1,726 ms
36,480 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 625 ms
27,776 KB
testcase_31 WA -
testcase_32 AC 1,368 ms
31,360 KB
testcase_33 AC 227 ms
27,520 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 442 ms
27,648 KB
testcase_37 WA -
testcase_38 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int,input().split())
A = list(map(int,input().split()))
mod = int(1e9 + 7)

for i in range(N):
	A[i] -= K

dp = [[0 for j in range(20010)] for i in range(105)]
dp[0][10000] = 1
ans = 0

for i in range(N):
	for j in range(20005):
		dp[i+1][j] += dp[i][j]
		if j >= A[i] and j - A[i] < 20005:
			dp[i+1][j] += dp[i][j - A[i]]
		dp[i+1][j] %= mod

for j in range(10005):
	ans += dp[N][j + 10000]

print(ans-1)
0