結果
| 問題 | No.1238 選抜クラス |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-25 23:38:34 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 596 ms / 2,000 ms |
| コード長 | 341 bytes |
| 記録 | |
| コンパイル時間 | 85 ms |
| コンパイル使用メモリ | 12,288 KB |
| 実行使用メモリ | 11,136 KB |
| 最終ジャッジ日時 | 2024-06-28 08:19:50 |
| 合計ジャッジ時間 | 11,194 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 36 |
ソースコード
n,k = map(int,input().split())
a = list(map(int,input().split()))
dp = [0]*(20001)
dp[10000] = 1
mod = 10**9+7
for i in range(n):
x = a[i]-k
ndp = [0]*(20001)
for j in range(20001):
if dp[j] > 0:
ndp[j+x] += dp[j]
ndp[j+x] %= mod
ndp[j] += dp[j]
dp = ndp
print((sum(dp[10000:])-1)%mod)