結果

問題 No.2453 Seat Allocation
ユーザー 👑 timitimi
提出日時 2023-09-01 22:33:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 434 bytes
コンパイル時間 1,630 ms
コンパイル使用メモリ 10,824 KB
実行使用メモリ 39,636 KB
最終ジャッジ日時 2023-09-01 22:34:03
合計ジャッジ時間 12,014 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
9,044 KB
testcase_01 AC 21 ms
9,000 KB
testcase_02 AC 21 ms
9,184 KB
testcase_03 AC 21 ms
9,044 KB
testcase_04 WA -
testcase_05 AC 670 ms
39,636 KB
testcase_06 AC 323 ms
18,840 KB
testcase_07 AC 232 ms
31,488 KB
testcase_08 AC 84 ms
12,016 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 300 ms
19,032 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 629 ms
23,384 KB
testcase_19 AC 765 ms
31,304 KB
testcase_20 AC 282 ms
19,340 KB
testcase_21 AC 419 ms
15,808 KB
testcase_22 AC 528 ms
19,072 KB
権限があれば一括ダウンロードができます

ソースコード

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**5
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