結果

問題 No.1238 選抜クラス
ユーザー KudeKude
提出日時 2020-09-25 21:45:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 105 ms / 2,000 ms
コード長 342 bytes
コンパイル時間 654 ms
コンパイル使用メモリ 87,044 KB
実行使用メモリ 92,048 KB
最終ジャッジ日時 2023-09-10 15:08:40
合計ジャッジ時間 5,294 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
76,636 KB
testcase_01 AC 79 ms
76,704 KB
testcase_02 AC 81 ms
77,512 KB
testcase_03 AC 77 ms
76,484 KB
testcase_04 AC 77 ms
76,440 KB
testcase_05 AC 77 ms
76,336 KB
testcase_06 AC 77 ms
76,308 KB
testcase_07 AC 79 ms
77,244 KB
testcase_08 AC 80 ms
77,612 KB
testcase_09 AC 82 ms
78,468 KB
testcase_10 AC 81 ms
77,328 KB
testcase_11 AC 83 ms
78,404 KB
testcase_12 AC 82 ms
77,896 KB
testcase_13 AC 82 ms
77,728 KB
testcase_14 AC 82 ms
77,748 KB
testcase_15 AC 82 ms
78,536 KB
testcase_16 AC 83 ms
78,264 KB
testcase_17 AC 105 ms
92,012 KB
testcase_18 AC 102 ms
91,344 KB
testcase_19 AC 103 ms
91,648 KB
testcase_20 AC 103 ms
91,064 KB
testcase_21 AC 99 ms
90,648 KB
testcase_22 AC 100 ms
91,692 KB
testcase_23 AC 103 ms
91,836 KB
testcase_24 AC 104 ms
91,756 KB
testcase_25 AC 98 ms
91,924 KB
testcase_26 AC 103 ms
92,048 KB
testcase_27 AC 103 ms
91,796 KB
testcase_28 AC 103 ms
92,040 KB
testcase_29 AC 104 ms
91,700 KB
testcase_30 AC 88 ms
80,772 KB
testcase_31 AC 94 ms
84,844 KB
testcase_32 AC 96 ms
88,320 KB
testcase_33 AC 77 ms
77,248 KB
testcase_34 AC 100 ms
89,532 KB
testcase_35 AC 90 ms
82,180 KB
testcase_36 AC 82 ms
79,092 KB
testcase_37 AC 88 ms
81,124 KB
testcase_38 AC 103 ms
91,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10 ** 9 + 7
n, k = map(int, input().split())
a = [int(x) - k for x in input().split()]
B = 100 * 100
dp = [0] * (2 * B + 1)
dp[B] = 1
for x in a:
    ndp = dp.copy()
    for i in range(2 * B + 1):
        if 0 <= i + x <= 2 * B:
            ndp[i+x] += dp[i]
            ndp[i+x] %= MOD
    dp = ndp
ans = sum(dp[B:]) % MOD
print(ans-1)
0