結果

問題 No.1238 選抜クラス
ユーザー marroncastlemarroncastle
提出日時 2020-09-25 21:57:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 349 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 87,196 KB
実行使用メモリ 92,240 KB
最終ジャッジ日時 2023-09-10 15:24:41
合計ジャッジ時間 5,892 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
76,712 KB
testcase_01 AC 86 ms
76,912 KB
testcase_02 AC 87 ms
77,816 KB
testcase_03 AC 79 ms
76,544 KB
testcase_04 AC 78 ms
76,648 KB
testcase_05 AC 81 ms
76,696 KB
testcase_06 AC 79 ms
76,632 KB
testcase_07 AC 84 ms
77,468 KB
testcase_08 AC 89 ms
78,108 KB
testcase_09 AC 96 ms
78,672 KB
testcase_10 AC 89 ms
77,628 KB
testcase_11 AC 91 ms
78,568 KB
testcase_12 AC 89 ms
78,012 KB
testcase_13 AC 92 ms
77,820 KB
testcase_14 AC 87 ms
78,024 KB
testcase_15 AC 90 ms
78,568 KB
testcase_16 AC 92 ms
78,288 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 128 ms
91,768 KB
testcase_20 WA -
testcase_21 AC 124 ms
90,996 KB
testcase_22 AC 122 ms
92,144 KB
testcase_23 AC 125 ms
92,088 KB
testcase_24 WA -
testcase_25 AC 124 ms
92,240 KB
testcase_26 WA -
testcase_27 AC 126 ms
92,080 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 101 ms
81,156 KB
testcase_31 WA -
testcase_32 AC 120 ms
88,684 KB
testcase_33 AC 85 ms
77,432 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 94 ms
79,488 KB
testcase_37 WA -
testcase_38 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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