結果

問題 No.2453 Seat Allocation
ユーザー hiro1729hiro1729
提出日時 2023-09-02 13:34:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 334 bytes
コンパイル時間 371 ms
コンパイル使用メモリ 10,916 KB
実行使用メモリ 30,864 KB
最終ジャッジ日時 2023-09-02 13:34:57
合計ジャッジ時間 8,047 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,004 KB
testcase_01 AC 18 ms
8,036 KB
testcase_02 AC 16 ms
7,976 KB
testcase_03 AC 16 ms
8,044 KB
testcase_04 AC 17 ms
7,948 KB
testcase_05 AC 407 ms
30,644 KB
testcase_06 AC 239 ms
19,024 KB
testcase_07 AC 118 ms
23,764 KB
testcase_08 AC 52 ms
10,232 KB
testcase_09 AC 611 ms
30,864 KB
testcase_10 AC 589 ms
30,364 KB
testcase_11 AC 613 ms
30,260 KB
testcase_12 AC 234 ms
19,156 KB
testcase_13 AC 263 ms
18,896 KB
testcase_14 AC 248 ms
19,212 KB
testcase_15 AC 276 ms
19,080 KB
testcase_16 AC 252 ms
20,472 KB
testcase_17 AC 16 ms
8,008 KB
testcase_18 AC 396 ms
19,256 KB
testcase_19 AC 472 ms
25,352 KB
testcase_20 AC 167 ms
15,716 KB
testcase_21 AC 225 ms
15,716 KB
testcase_22 AC 369 ms
19,176 KB
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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 = [(-x / b[0] * 100000, 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, (-a[k] / b[j] * 100000, k))
0