結果
| 問題 |
No.1238 選抜クラス
|
| コンテスト | |
| ユーザー |
ntuda
|
| 提出日時 | 2024-12-04 22:23:27 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 463 bytes |
| コンパイル時間 | 419 ms |
| コンパイル使用メモリ | 82,308 KB |
| 実行使用メモリ | 209,148 KB |
| 最終ジャッジ日時 | 2024-12-04 22:23:46 |
| 合計ジャッジ時間 | 18,885 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 TLE * 4 |
ソースコード
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