結果

問題 No.1238 選抜クラス
ユーザー O2MTO2MT
提出日時 2020-09-30 11:19:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,328 ms / 2,000 ms
コード長 415 bytes
コンパイル時間 927 ms
コンパイル使用メモリ 10,908 KB
実行使用メモリ 36,320 KB
最終ジャッジ日時 2023-09-19 06:04:32
合計ジャッジ時間 28,161 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
8,724 KB
testcase_01 AC 60 ms
8,988 KB
testcase_02 AC 134 ms
9,860 KB
testcase_03 AC 32 ms
8,652 KB
testcase_04 AC 32 ms
8,524 KB
testcase_05 AC 32 ms
8,732 KB
testcase_06 AC 32 ms
8,600 KB
testcase_07 AC 97 ms
9,368 KB
testcase_08 AC 135 ms
9,864 KB
testcase_09 AC 197 ms
10,720 KB
testcase_10 AC 109 ms
9,544 KB
testcase_11 AC 186 ms
10,516 KB
testcase_12 AC 146 ms
10,076 KB
testcase_13 AC 147 ms
9,940 KB
testcase_14 AC 137 ms
9,796 KB
testcase_15 AC 194 ms
10,608 KB
testcase_16 AC 189 ms
10,448 KB
testcase_17 AC 1,290 ms
31,660 KB
testcase_18 AC 1,257 ms
28,760 KB
testcase_19 AC 1,271 ms
34,264 KB
testcase_20 AC 1,222 ms
31,280 KB
testcase_21 AC 1,190 ms
30,456 KB
testcase_22 AC 1,313 ms
24,572 KB
testcase_23 AC 1,268 ms
24,476 KB
testcase_24 AC 1,286 ms
24,516 KB
testcase_25 AC 1,272 ms
24,368 KB
testcase_26 AC 1,319 ms
31,632 KB
testcase_27 AC 1,328 ms
36,320 KB
testcase_28 AC 1,305 ms
30,568 KB
testcase_29 AC 1,230 ms
29,340 KB
testcase_30 AC 409 ms
13,400 KB
testcase_31 AC 736 ms
18,536 KB
testcase_32 AC 1,018 ms
25,700 KB
testcase_33 AC 98 ms
9,312 KB
testcase_34 AC 1,109 ms
25,436 KB
testcase_35 AC 499 ms
14,780 KB
testcase_36 AC 242 ms
11,296 KB
testcase_37 AC 441 ms
13,800 KB
testcase_38 AC 1,250 ms
28,832 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 (j-a) >= 0 and 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