結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
9,004 KB
testcase_01 AC 22 ms
9,160 KB
testcase_02 AC 22 ms
9,096 KB
testcase_03 AC 21 ms
9,188 KB
testcase_04 AC 22 ms
9,020 KB
testcase_05 AC 718 ms
39,716 KB
testcase_06 AC 366 ms
18,972 KB
testcase_07 AC 252 ms
31,648 KB
testcase_08 AC 86 ms
11,856 KB
testcase_09 AC 1,018 ms
38,380 KB
testcase_10 AC 971 ms
38,112 KB
testcase_11 AC 979 ms
38,388 KB
testcase_12 AC 329 ms
18,860 KB
testcase_13 AC 375 ms
18,792 KB
testcase_14 AC 330 ms
18,852 KB
testcase_15 AC 406 ms
18,988 KB
testcase_16 WA -
testcase_17 AC 21 ms
9,128 KB
testcase_18 AC 639 ms
23,396 KB
testcase_19 AC 803 ms
31,388 KB
testcase_20 AC 301 ms
19,424 KB
testcase_21 AC 382 ms
15,860 KB
testcase_22 AC 601 ms
19,088 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**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)
0