結果

問題 No.1238 選抜クラス
ユーザー 👑 rin204rin204
提出日時 2022-07-04 17:11:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 395 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 86,780 KB
実行使用メモリ 92,104 KB
最終ジャッジ日時 2023-08-21 00:55:06
合計ジャッジ時間 6,657 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
76,664 KB
testcase_01 AC 84 ms
76,736 KB
testcase_02 AC 88 ms
77,668 KB
testcase_03 AC 83 ms
76,296 KB
testcase_04 AC 78 ms
76,380 KB
testcase_05 AC 78 ms
76,380 KB
testcase_06 AC 78 ms
76,388 KB
testcase_07 AC 86 ms
77,116 KB
testcase_08 AC 88 ms
77,764 KB
testcase_09 AC 91 ms
78,204 KB
testcase_10 AC 88 ms
77,412 KB
testcase_11 AC 90 ms
78,276 KB
testcase_12 AC 89 ms
77,780 KB
testcase_13 AC 88 ms
78,024 KB
testcase_14 AC 86 ms
77,764 KB
testcase_15 AC 88 ms
78,208 KB
testcase_16 AC 88 ms
78,264 KB
testcase_17 AC 118 ms
92,072 KB
testcase_18 AC 120 ms
91,620 KB
testcase_19 AC 117 ms
91,800 KB
testcase_20 AC 116 ms
91,204 KB
testcase_21 AC 114 ms
90,812 KB
testcase_22 AC 116 ms
91,888 KB
testcase_23 AC 117 ms
92,000 KB
testcase_24 AC 117 ms
92,092 KB
testcase_25 AC 116 ms
92,048 KB
testcase_26 AC 119 ms
92,092 KB
testcase_27 AC 118 ms
92,104 KB
testcase_28 AC 123 ms
92,084 KB
testcase_29 AC 122 ms
91,692 KB
testcase_30 AC 95 ms
81,000 KB
testcase_31 AC 104 ms
84,908 KB
testcase_32 AC 111 ms
88,436 KB
testcase_33 AC 87 ms
76,940 KB
testcase_34 AC 118 ms
89,644 KB
testcase_35 AC 102 ms
82,332 KB
testcase_36 AC 96 ms
79,172 KB
testcase_37 AC 100 ms
81,336 KB
testcase_38 AC 121 ms
91,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10 ** 9 + 7

n, k = map(int, input().split())
A = list(map(int, input().split()))
A = [a - k for a in A]
dp = [0] * 20200
dp[0] = 1
for a in A:
    ndp = [0] * 20200
    for i in range(-10000, 10001):
        ndp[i] += dp[i]
        ndp[i] %= MOD
        ndp[i + a] += dp[i]
        ndp[i + a] %= MOD
    dp = ndp
ans = -1
for i in range(10001):
    ans += dp[i]
    ans %= MOD
print(ans)
0