結果

問題 No.2453 Seat Allocation
コンテスト
ユーザー timi
提出日時 2023-09-01 22:27:36
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 360 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 230 ms
コンパイル使用メモリ 85,504 KB
実行使用メモリ 110,464 KB
最終ジャッジ日時 2026-06-06 14:12:23
合計ジャッジ時間 8,271 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N,M=map(int, input().split())
A=list(map(int, input().split()))
B=list(map(int, input().split()))

b=B[0]
import heapq
C=[];e=10**15
for i in range(N):
  c=-(e*A[i]-i)/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 
  cc=-(e*A[i]-i)/B[r+1]
  heapq.heappush(C,(cc,i,r+1))
  #print(C)
0