結果
| 問題 | No.2453 Seat Allocation |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-09-04 01:11:32 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 367 bytes |
| 記録 | |
| コンパイル時間 | 134 ms |
| コンパイル使用メモリ | 85,640 KB |
| 実行使用メモリ | 111,024 KB |
| 最終ジャッジ日時 | 2026-03-06 06:52:33 |
| 合計ジャッジ時間 | 5,007 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 WA * 2 |
ソースコード
from heapq import heappop, heappush
n, m = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
H = []
for i in range(n):
heappush(H, (-A[i] / B[0], i, 0))
for _ in range(m):
_, ans, idx = heappop(H)
print(ans + 1)
idx += 1
if idx == m:
continue
heappush(H, (-A[ans] / B[idx], ans, idx))