結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 168 ms
27,648 KB
testcase_01 AC 191 ms
27,520 KB
testcase_02 AC 278 ms
27,520 KB
testcase_03 AC 152 ms
27,520 KB
testcase_04 AC 153 ms
27,392 KB
testcase_05 AC 153 ms
27,648 KB
testcase_06 AC 152 ms
27,648 KB
testcase_07 AC 229 ms
27,520 KB
testcase_08 AC 288 ms
27,520 KB
testcase_09 AC 353 ms
27,520 KB
testcase_10 AC 250 ms
27,648 KB
testcase_11 AC 359 ms
27,648 KB
testcase_12 AC 302 ms
27,520 KB
testcase_13 AC 298 ms
27,520 KB
testcase_14 AC 275 ms
27,520 KB
testcase_15 AC 372 ms
27,648 KB
testcase_16 AC 333 ms
27,392 KB
testcase_17 AC 1,685 ms
32,768 KB
testcase_18 AC 1,694 ms
31,232 KB
testcase_19 AC 1,741 ms
35,072 KB
testcase_20 AC 1,616 ms
33,408 KB
testcase_21 AC 1,601 ms
33,152 KB
testcase_22 AC 1,763 ms
27,520 KB
testcase_23 AC 1,767 ms
27,648 KB
testcase_24 AC 1,764 ms
27,648 KB
testcase_25 AC 1,694 ms
27,520 KB
testcase_26 AC 1,733 ms
32,640 KB
testcase_27 AC 1,792 ms
36,608 KB
testcase_28 AC 1,824 ms
32,000 KB
testcase_29 AC 1,719 ms
31,616 KB
testcase_30 AC 608 ms
27,776 KB
testcase_31 AC 1,007 ms
28,800 KB
testcase_32 AC 1,383 ms
31,488 KB
testcase_33 AC 235 ms
27,520 KB
testcase_34 AC 1,484 ms
30,208 KB
testcase_35 AC 742 ms
27,904 KB
testcase_36 AC 416 ms
27,648 KB
testcase_37 AC 662 ms
28,032 KB
testcase_38 AC 1,629 ms
31,744 KB
権限があれば一括ダウンロードができます

ソースコード

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]
	ans %= mod

ans -= 1
if ans < 0:
	ans += mod
print(ans)
0