結果
| 問題 | No.1238 選抜クラス |
| コンテスト | |
| ユーザー |
ntuda
|
| 提出日時 | 2024-12-04 22:23:27 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 463 bytes |
| 記録 | |
| コンパイル時間 | 507 ms |
| コンパイル使用メモリ | 85,280 KB |
| 実行使用メモリ | 201,696 KB |
| 最終ジャッジ日時 | 2026-05-24 16:30:09 |
| 合計ジャッジ時間 | 18,402 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 35 TLE * 1 |
ソースコード
from collections import defaultdict
MOD = 10 ** 9 + 7
N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
dic = defaultdict(int)
dic[(0, 0)] = 1
ans = 0
for i, a in enumerate(A):
tmp = pow(2, N - i - 1, MOD)
for (x, y), v in list(dic.items()):
if y + a >= K * (x + 1):
ans += v * tmp
ans %= MOD
else:
dic[(x + 1, y + a)] += v
dic[(x + 1, y + a)] %= MOD
print(ans)
ntuda