結果

問題 No.2453 Seat Allocation
ユーザー ニックネームニックネーム
提出日時 2023-09-01 21:48:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 990 ms / 2,000 ms
コード長 369 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 41,752 KB
最終ジャッジ日時 2024-06-25 09:24:25
合計ジャッジ時間 10,796 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
11,136 KB
testcase_01 AC 33 ms
11,264 KB
testcase_02 AC 33 ms
11,264 KB
testcase_03 AC 33 ms
11,136 KB
testcase_04 AC 32 ms
11,136 KB
testcase_05 AC 703 ms
41,752 KB
testcase_06 AC 341 ms
22,100 KB
testcase_07 AC 242 ms
33,764 KB
testcase_08 AC 103 ms
13,952 KB
testcase_09 AC 974 ms
40,748 KB
testcase_10 AC 990 ms
40,316 KB
testcase_11 AC 970 ms
40,568 KB
testcase_12 AC 329 ms
22,432 KB
testcase_13 AC 395 ms
22,224 KB
testcase_14 AC 303 ms
22,300 KB
testcase_15 AC 446 ms
22,152 KB
testcase_16 AC 370 ms
21,324 KB
testcase_17 AC 33 ms
11,136 KB
testcase_18 AC 671 ms
25,740 KB
testcase_19 AC 791 ms
33,756 KB
testcase_20 AC 310 ms
21,268 KB
testcase_21 AC 389 ms
18,888 KB
testcase_22 AC 575 ms
22,332 KB
testcase_23 AC 33 ms
11,264 KB
testcase_24 AC 33 ms
11,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heappop,heappush
from decimal import Decimal
n,m = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
hq = []
for i in range(n): heappush(hq,(Decimal(-a[i])/Decimal(b[0]),i,0))
while True:
    _,i,j = heappop(hq); print(i+1); m -= 1
    if m==0: break
    heappush(hq,(Decimal(-a[i])/Decimal(b[j+1]),i,j+1))
0