結果

問題 No.2453 Seat Allocation
ユーザー titiatitia
提出日時 2023-09-01 23:09:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 428 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 10,804 KB
実行使用メモリ 30,088 KB
最終ジャッジ日時 2023-09-02 11:14:20
合計ジャッジ時間 7,107 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,108 KB
testcase_01 AC 16 ms
8,016 KB
testcase_02 AC 16 ms
8,008 KB
testcase_03 AC 16 ms
8,028 KB
testcase_04 AC 15 ms
8,024 KB
testcase_05 AC 420 ms
29,760 KB
testcase_06 AC 215 ms
19,160 KB
testcase_07 AC 137 ms
25,972 KB
testcase_08 AC 55 ms
10,432 KB
testcase_09 AC 601 ms
29,840 KB
testcase_10 AC 554 ms
30,088 KB
testcase_11 AC 560 ms
30,004 KB
testcase_12 AC 200 ms
19,136 KB
testcase_13 AC 231 ms
19,172 KB
testcase_14 AC 218 ms
19,060 KB
testcase_15 AC 247 ms
19,132 KB
testcase_16 AC 222 ms
19,024 KB
testcase_17 AC 16 ms
7,972 KB
testcase_18 AC 354 ms
19,736 KB
testcase_19 AC 443 ms
25,120 KB
testcase_20 AC 177 ms
15,760 KB
testcase_21 AC 216 ms
16,032 KB
testcase_22 AC 313 ms
19,856 KB
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

from heapq import heappop,heappush

N,M=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))

for i in range(N):
    A[i]*=10**9


H=[]
for i in range(N):
    H.append((-A[i]/B[0],i+1,0))

H.sort()
count=0

while H and count<M:
    count+=1
    x,ind,c=heappop(H)

    print(ind)

    if c<M-1:
        c+=1
        heappush(H,(-A[ind-1]/B[c],ind,c))
0