結果

問題 No.2453 Seat Allocation
ユーザー 👑 timitimi
提出日時 2023-09-01 22:27:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 360 bytes
コンパイル時間 880 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 108,384 KB
最終ジャッジ日時 2023-09-01 22:27:50
合計ジャッジ時間 10,419 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,292 KB
testcase_01 AC 77 ms
71,116 KB
testcase_02 AC 73 ms
71,380 KB
testcase_03 AC 75 ms
71,280 KB
testcase_04 AC 76 ms
71,384 KB
testcase_05 AC 504 ms
104,280 KB
testcase_06 AC 229 ms
91,352 KB
testcase_07 AC 192 ms
95,164 KB
testcase_08 AC 154 ms
79,412 KB
testcase_09 AC 840 ms
107,776 KB
testcase_10 AC 809 ms
108,256 KB
testcase_11 AC 862 ms
108,384 KB
testcase_12 WA -
testcase_13 AC 246 ms
91,836 KB
testcase_14 AC 176 ms
91,232 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 608 ms
94,348 KB
testcase_19 AC 657 ms
102,956 KB
testcase_20 AC 332 ms
87,452 KB
testcase_21 AC 348 ms
86,680 KB
testcase_22 AC 497 ms
92,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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