結果

問題 No.2453 Seat Allocation
ユーザー hiro1729hiro1729
提出日時 2023-09-02 13:38:02
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 362 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 87,216 KB
実行使用メモリ 176,044 KB
最終ジャッジ日時 2023-09-02 13:38:17
合計ジャッジ時間 13,340 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 215 ms
89,280 KB
testcase_01 AC 218 ms
88,996 KB
testcase_02 AC 212 ms
89,032 KB
testcase_03 AC 233 ms
89,044 KB
testcase_04 AC 226 ms
91,392 KB
testcase_05 AC 1,603 ms
157,240 KB
testcase_06 AC 970 ms
108,476 KB
testcase_07 AC 1,109 ms
129,096 KB
testcase_08 AC 899 ms
103,852 KB
testcase_09 TLE -
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from decimal import Decimal
from heapq import *
n, m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = [1] * n
h = [(-Decimal(x) / b[0], i) for i, x in enumerate(a)]
heapify(h)
while m:
	_, k = heappop(h)
	print(k + 1)
	m -= 1
	j = d[k]
	d[k] = j + 1
	if j < len(b):
		heappush(h, (-Decimal(a[k]) / b[j], k))
0