結果
| 問題 | No.2453 Seat Allocation | 
| コンテスト | |
| ユーザー |  ニックネーム | 
| 提出日時 | 2023-09-01 21:50:06 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                TLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 356 bytes | 
| コンパイル時間 | 189 ms | 
| コンパイル使用メモリ | 12,160 KB | 
| 実行使用メモリ | 81,744 KB | 
| 最終ジャッジ日時 | 2025-01-03 08:16:01 | 
| 合計ジャッジ時間 | 31,651 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 15 TLE * 7 | 
ソースコード
from heapq import heappop,heappush
from fractions import Fraction
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,(Fraction(-a[i],b[0]),i,0))
while True:
    _,i,j = heappop(hq); print(i+1); m -= 1
    if m==0: break
    heappush(hq,(Fraction(-a[i],b[j+1]),i,j+1))
            
            
            
        