結果

問題 No.2453 Seat Allocation
ユーザー ニックネームニックネーム
提出日時 2023-09-01 21:48:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 948 ms / 2,000 ms
コード長 369 bytes
コンパイル時間 236 ms
コンパイル使用メモリ 10,672 KB
実行使用メモリ 39,444 KB
最終ジャッジ日時 2023-09-07 15:34:58
合計ジャッジ時間 10,030 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
9,076 KB
testcase_01 AC 22 ms
9,060 KB
testcase_02 AC 22 ms
9,064 KB
testcase_03 AC 22 ms
9,000 KB
testcase_04 AC 21 ms
8,996 KB
testcase_05 AC 609 ms
39,348 KB
testcase_06 AC 282 ms
19,736 KB
testcase_07 AC 209 ms
31,544 KB
testcase_08 AC 79 ms
11,700 KB
testcase_09 AC 895 ms
39,444 KB
testcase_10 AC 921 ms
38,296 KB
testcase_11 AC 948 ms
38,256 KB
testcase_12 AC 280 ms
20,024 KB
testcase_13 AC 329 ms
19,772 KB
testcase_14 AC 261 ms
19,932 KB
testcase_15 AC 370 ms
19,740 KB
testcase_16 AC 312 ms
20,336 KB
testcase_17 AC 22 ms
9,024 KB
testcase_18 AC 591 ms
23,420 KB
testcase_19 AC 722 ms
31,644 KB
testcase_20 AC 277 ms
18,748 KB
testcase_21 AC 347 ms
16,596 KB
testcase_22 AC 515 ms
20,004 KB
testcase_23 AC 21 ms
9,068 KB
testcase_24 AC 22 ms
8,916 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