結果
| 問題 | No.2453 Seat Allocation | 
| コンテスト | |
| ユーザー |  timi | 
| 提出日時 | 2023-09-01 22:34:36 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 435 bytes | 
| コンパイル時間 | 426 ms | 
| コンパイル使用メモリ | 12,288 KB | 
| 実行使用メモリ | 42,732 KB | 
| 最終ジャッジ日時 | 2025-01-03 09:56:42 | 
| 合計ジャッジ時間 | 13,397 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 21 WA * 1 | 
ソースコード
N,M=map(int, input().split())
A=list(map(int, input().split()))
B=list(map(int, input().split()))
from decimal import Decimal
b=B[0]
import heapq
C=[];e=10**30
for i in range(N):
  x=-(e*A[i]-i)
  c=Decimal(x)/Decimal(b)
  heapq.heappush(C,(c,i,0))
#print(C)  
for _ in range(M):
  c,i,r=heapq.heappop(C)
  print(i+1)
  if r+1==M:
    continue 
  x=-(e*A[i]-i)
  cc=Decimal(x)/Decimal(B[r+1])
  heapq.heappush(C,(cc,i,r+1))
  #print(C)
            
            
            
        