結果
| 問題 | No.2453 Seat Allocation |
| コンテスト | |
| ユーザー |
ニックネーム
|
| 提出日時 | 2023-09-01 21:48:38 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 796 ms / 2,000 ms |
| + 577µs | |
| コード長 | 369 bytes |
| 記録 | |
| コンパイル時間 | 290 ms |
| コンパイル使用メモリ | 21,540 KB |
| 実行使用メモリ | 49,072 KB |
| 最終ジャッジ日時 | 2026-07-12 09:21:40 |
| 合計ジャッジ時間 | 11,387 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
ソースコード
from heapq import heappop,heappush
from decimal import Decimal
n,m = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
hq = []
for i in range(n): heappush(hq,(Decimal(-a[i])/Decimal(b[0]),i,0))
while True:
_,i,j = heappop(hq); print(i+1); m -= 1
if m==0: break
heappush(hq,(Decimal(-a[i])/Decimal(b[j+1]),i,j+1))
ニックネーム