結果

問題 No.1238 選抜クラス
ユーザー kohei2019kohei2019
提出日時 2022-07-18 21:05:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 391 bytes
コンパイル時間 825 ms
コンパイル使用メモリ 86,692 KB
実行使用メモリ 99,748 KB
最終ジャッジ日時 2023-09-13 11:37:33
合計ジャッジ時間 6,534 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
76,484 KB
testcase_01 AC 78 ms
76,656 KB
testcase_02 AC 82 ms
78,196 KB
testcase_03 AC 76 ms
76,328 KB
testcase_04 AC 76 ms
76,156 KB
testcase_05 AC 78 ms
76,304 KB
testcase_06 AC 75 ms
76,308 KB
testcase_07 AC 81 ms
77,624 KB
testcase_08 AC 81 ms
78,304 KB
testcase_09 AC 87 ms
79,400 KB
testcase_10 AC 84 ms
77,764 KB
testcase_11 AC 84 ms
79,244 KB
testcase_12 AC 84 ms
78,484 KB
testcase_13 AC 84 ms
78,536 KB
testcase_14 AC 83 ms
78,332 KB
testcase_15 AC 84 ms
79,404 KB
testcase_16 AC 85 ms
79,168 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 121 ms
99,264 KB
testcase_20 WA -
testcase_21 AC 120 ms
97,668 KB
testcase_22 AC 116 ms
99,608 KB
testcase_23 AC 121 ms
99,480 KB
testcase_24 WA -
testcase_25 AC 117 ms
99,616 KB
testcase_26 WA -
testcase_27 AC 121 ms
99,644 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 93 ms
83,352 KB
testcase_31 WA -
testcase_32 AC 113 ms
94,176 KB
testcase_33 AC 81 ms
77,608 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 91 ms
80,468 KB
testcase_37 WA -
testcase_38 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
lsA = list(map(int,input().split()))
dp = [0]*(30000+1)
offset = 15000
dp[offset] = 1
mod = 10**9+7
for i in range(N):
    a = lsA[i]-K
    dp2 = [0]*(30000+1)
    for j in range(30000+1):
        if 0<= j+a <=30000:
            dp2[j+a] += dp[j]
            dp2[j+a] %= mod
        dp2[j] += dp[j]
        dp2[j] %= mod
    dp = dp2
print(sum(dp[offset:])-1)
0