結果

問題 No.1238 選抜クラス
ユーザー kohei2019kohei2019
提出日時 2022-07-18 21:05:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 396 bytes
コンパイル時間 498 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 99,672 KB
最終ジャッジ日時 2023-09-13 11:38:10
合計ジャッジ時間 6,579 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
76,544 KB
testcase_01 AC 80 ms
76,844 KB
testcase_02 AC 82 ms
78,308 KB
testcase_03 AC 77 ms
76,328 KB
testcase_04 AC 77 ms
76,356 KB
testcase_05 AC 76 ms
76,148 KB
testcase_06 AC 78 ms
76,144 KB
testcase_07 AC 82 ms
77,484 KB
testcase_08 AC 83 ms
78,008 KB
testcase_09 AC 86 ms
79,244 KB
testcase_10 AC 83 ms
77,876 KB
testcase_11 AC 84 ms
79,232 KB
testcase_12 AC 85 ms
78,448 KB
testcase_13 AC 85 ms
78,604 KB
testcase_14 AC 83 ms
78,240 KB
testcase_15 AC 87 ms
79,356 KB
testcase_16 AC 85 ms
79,116 KB
testcase_17 AC 125 ms
99,588 KB
testcase_18 AC 126 ms
98,876 KB
testcase_19 AC 125 ms
99,068 KB
testcase_20 AC 121 ms
98,572 KB
testcase_21 AC 121 ms
97,764 KB
testcase_22 AC 118 ms
99,520 KB
testcase_23 AC 124 ms
99,672 KB
testcase_24 AC 121 ms
99,404 KB
testcase_25 AC 117 ms
99,556 KB
testcase_26 AC 123 ms
99,652 KB
testcase_27 AC 124 ms
99,560 KB
testcase_28 AC 127 ms
99,532 KB
testcase_29 AC 124 ms
99,060 KB
testcase_30 AC 92 ms
83,240 KB
testcase_31 AC 104 ms
89,028 KB
testcase_32 AC 115 ms
94,164 KB
testcase_33 AC 81 ms
77,572 KB
testcase_34 AC 117 ms
96,128 KB
testcase_35 AC 98 ms
85,000 KB
testcase_36 AC 89 ms
80,372 KB
testcase_37 AC 97 ms
83,624 KB
testcase_38 AC 123 ms
98,504 KB
権限があれば一括ダウンロードができます

ソースコード

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