結果

問題 No.2453 Seat Allocation
ユーザー 👑 timitimi
提出日時 2023-09-01 22:31:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 435 bytes
コンパイル時間 749 ms
コンパイル使用メモリ 87,264 KB
実行使用メモリ 162,304 KB
最終ジャッジ日時 2023-09-01 22:31:22
合計ジャッジ時間 13,376 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 218 ms
88,780 KB
testcase_01 AC 217 ms
89,048 KB
testcase_02 AC 234 ms
89,020 KB
testcase_03 AC 212 ms
88,804 KB
testcase_04 WA -
testcase_05 TLE -
testcase_06 AC 1,054 ms
102,352 KB
testcase_07 AC 1,134 ms
130,248 KB
testcase_08 AC 771 ms
100,092 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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