結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
9,128 KB
testcase_01 AC 22 ms
9,136 KB
testcase_02 AC 21 ms
9,224 KB
testcase_03 AC 22 ms
9,084 KB
testcase_04 WA -
testcase_05 AC 693 ms
39,540 KB
testcase_06 AC 336 ms
18,928 KB
testcase_07 AC 250 ms
31,584 KB
testcase_08 AC 86 ms
12,024 KB
testcase_09 AC 962 ms
38,448 KB
testcase_10 AC 1,013 ms
38,132 KB
testcase_11 AC 1,025 ms
38,472 KB
testcase_12 WA -
testcase_13 AC 367 ms
18,892 KB
testcase_14 AC 301 ms
18,896 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 656 ms
23,512 KB
testcase_19 AC 780 ms
31,528 KB
testcase_20 AC 301 ms
19,328 KB
testcase_21 AC 359 ms
15,716 KB
testcase_22 AC 546 ms
19,280 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**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