結果

問題 No.1238 選抜クラス
ユーザー 👑 platinumplatinum
提出日時 2020-09-08 00:06:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 460 bytes
コンパイル時間 380 ms
コンパイル使用メモリ 82,316 KB
実行使用メモリ 79,232 KB
最終ジャッジ日時 2024-05-07 00:23:39
合計ジャッジ時間 4,650 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
76,672 KB
testcase_01 AC 64 ms
76,544 KB
testcase_02 AC 67 ms
76,672 KB
testcase_03 AC 65 ms
76,288 KB
testcase_04 AC 63 ms
76,032 KB
testcase_05 AC 63 ms
76,544 KB
testcase_06 AC 64 ms
76,288 KB
testcase_07 AC 66 ms
76,544 KB
testcase_08 AC 67 ms
76,928 KB
testcase_09 AC 71 ms
77,568 KB
testcase_10 AC 68 ms
77,184 KB
testcase_11 AC 70 ms
76,800 KB
testcase_12 AC 69 ms
76,928 KB
testcase_13 AC 69 ms
77,696 KB
testcase_14 AC 68 ms
76,800 KB
testcase_15 AC 70 ms
77,056 KB
testcase_16 AC 70 ms
77,184 KB
testcase_17 AC 97 ms
77,568 KB
testcase_18 AC 99 ms
79,232 KB
testcase_19 AC 96 ms
77,696 KB
testcase_20 AC 97 ms
77,824 KB
testcase_21 AC 94 ms
78,464 KB
testcase_22 AC 94 ms
76,672 KB
testcase_23 AC 99 ms
77,952 KB
testcase_24 AC 98 ms
78,080 KB
testcase_25 AC 96 ms
76,928 KB
testcase_26 AC 97 ms
77,824 KB
testcase_27 AC 97 ms
77,824 KB
testcase_28 AC 99 ms
78,336 KB
testcase_29 AC 99 ms
78,208 KB
testcase_30 AC 76 ms
77,952 KB
testcase_31 AC 87 ms
78,336 KB
testcase_32 AC 91 ms
78,336 KB
testcase_33 AC 69 ms
76,544 KB
testcase_34 AC 99 ms
78,848 KB
testcase_35 AC 80 ms
78,524 KB
testcase_36 AC 72 ms
77,440 KB
testcase_37 AC 76 ms
77,440 KB
testcase_38 AC 96 ms
78,208 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