結果
| 問題 | No.1238 選抜クラス |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-28 13:04:46 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 305 bytes |
| 記録 | |
| コンパイル時間 | 428 ms |
| コンパイル使用メモリ | 82,256 KB |
| 実行使用メモリ | 77,508 KB |
| 最終ジャッジ日時 | 2024-12-29 06:54:51 |
| 合計ジャッジ時間 | 4,299 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 WA * 14 |
ソースコード
from collections import defaultdict
N, K = map(int, input().split())
A = list(map(lambda x: int(x) - K, input().split()))
dp = defaultdict(int)
dp[0] = 1
for a in A:
for key, cnt in dp.copy().items():
dp[key + a] += cnt
ans = sum(cnt for key, cnt in dp.items() if key >= 0)
print(ans - 1)