結果

問題 No.1238 選抜クラス
ユーザー marroncastlemarroncastle
提出日時 2020-09-25 22:16:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 136 ms / 2,000 ms
コード長 353 bytes
コンパイル時間 552 ms
コンパイル使用メモリ 87,060 KB
実行使用メモリ 92,264 KB
最終ジャッジ日時 2023-09-10 15:31:45
合計ジャッジ時間 5,963 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
76,752 KB
testcase_01 AC 87 ms
76,976 KB
testcase_02 AC 92 ms
77,752 KB
testcase_03 AC 83 ms
76,448 KB
testcase_04 AC 83 ms
76,572 KB
testcase_05 AC 82 ms
76,420 KB
testcase_06 AC 83 ms
76,632 KB
testcase_07 AC 89 ms
77,252 KB
testcase_08 AC 90 ms
77,740 KB
testcase_09 AC 96 ms
78,764 KB
testcase_10 AC 91 ms
77,452 KB
testcase_11 AC 93 ms
78,404 KB
testcase_12 AC 93 ms
78,096 KB
testcase_13 AC 93 ms
77,924 KB
testcase_14 AC 89 ms
77,784 KB
testcase_15 AC 93 ms
78,752 KB
testcase_16 AC 95 ms
78,456 KB
testcase_17 AC 133 ms
92,204 KB
testcase_18 AC 134 ms
92,092 KB
testcase_19 AC 128 ms
91,888 KB
testcase_20 AC 127 ms
91,336 KB
testcase_21 AC 125 ms
90,740 KB
testcase_22 AC 126 ms
92,072 KB
testcase_23 AC 130 ms
92,108 KB
testcase_24 AC 130 ms
92,112 KB
testcase_25 AC 125 ms
91,940 KB
testcase_26 AC 128 ms
92,152 KB
testcase_27 AC 127 ms
92,124 KB
testcase_28 AC 131 ms
92,264 KB
testcase_29 AC 132 ms
91,724 KB
testcase_30 AC 101 ms
81,208 KB
testcase_31 AC 115 ms
85,100 KB
testcase_32 AC 121 ms
88,348 KB
testcase_33 AC 90 ms
77,408 KB
testcase_34 AC 131 ms
89,888 KB
testcase_35 AC 109 ms
82,448 KB
testcase_36 AC 99 ms
79,476 KB
testcase_37 AC 105 ms
81,320 KB
testcase_38 AC 136 ms
91,188 KB
権限があれば一括ダウンロードができます

ソースコード

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%mod)
0