結果

問題 No.1238 選抜クラス
ユーザー O2MTO2MT
提出日時 2020-09-30 11:36:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 175 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 2,066 ms
コンパイル使用メモリ 86,628 KB
実行使用メモリ 101,612 KB
最終ジャッジ日時 2023-09-19 06:20:35
合計ジャッジ時間 7,904 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
76,712 KB
testcase_01 AC 86 ms
76,632 KB
testcase_02 AC 89 ms
77,756 KB
testcase_03 AC 84 ms
76,504 KB
testcase_04 AC 88 ms
76,400 KB
testcase_05 AC 85 ms
76,576 KB
testcase_06 AC 84 ms
76,332 KB
testcase_07 AC 91 ms
77,076 KB
testcase_08 AC 92 ms
77,752 KB
testcase_09 AC 96 ms
78,448 KB
testcase_10 AC 91 ms
77,224 KB
testcase_11 AC 93 ms
78,336 KB
testcase_12 AC 92 ms
77,956 KB
testcase_13 AC 91 ms
77,744 KB
testcase_14 AC 89 ms
77,584 KB
testcase_15 AC 94 ms
78,500 KB
testcase_16 AC 92 ms
78,432 KB
testcase_17 AC 175 ms
98,004 KB
testcase_18 AC 169 ms
97,028 KB
testcase_19 AC 168 ms
97,644 KB
testcase_20 AC 166 ms
97,292 KB
testcase_21 AC 162 ms
95,860 KB
testcase_22 AC 153 ms
98,088 KB
testcase_23 AC 170 ms
101,612 KB
testcase_24 AC 155 ms
97,988 KB
testcase_25 AC 152 ms
97,812 KB
testcase_26 AC 173 ms
97,628 KB
testcase_27 AC 174 ms
98,736 KB
testcase_28 AC 173 ms
98,564 KB
testcase_29 AC 168 ms
97,252 KB
testcase_30 AC 100 ms
81,156 KB
testcase_31 AC 110 ms
84,804 KB
testcase_32 AC 135 ms
89,784 KB
testcase_33 AC 87 ms
77,212 KB
testcase_34 AC 156 ms
94,732 KB
testcase_35 AC 105 ms
82,524 KB
testcase_36 AC 101 ms
79,168 KB
testcase_37 AC 99 ms
81,212 KB
testcase_38 AC 166 ms
96,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
A = list(map(int, input().split()))
for i in range(N):
  A[i] -= K
MOD = 10**9+7
dp = [[0 for _ in range(20001)] for _ in range(N+1)]
dp[0][10000] = 1
for i in range(N):
  a = A[i]
  for j in range(20001):
    dp[i+1][j] = dp[i][j]
    if 0 <= j-a <= 20000:
      dp[i + 1][j] += dp[i][j-a]
ans = 0
for i in range(10000, 20001):
  ans += dp[N][i]
  ans %= MOD
print(ans-1)
0