結果

問題 No.2453 Seat Allocation
ユーザー ニックネーム
提出日時 2023-09-01 21:48:38
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 1,002 ms / 2,000 ms
コード長 369 bytes
コンパイル時間 750 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 42,632 KB
最終ジャッジ日時 2025-06-20 01:44:01
合計ジャッジ時間 10,705 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

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))
0