結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,988 KB
testcase_01 AC 16 ms
7,944 KB
testcase_02 AC 16 ms
8,120 KB
testcase_03 AC 16 ms
8,024 KB
testcase_04 AC 16 ms
7,976 KB
testcase_05 AC 416 ms
30,800 KB
testcase_06 AC 228 ms
18,892 KB
testcase_07 AC 116 ms
23,792 KB
testcase_08 AC 51 ms
10,272 KB
testcase_09 AC 572 ms
30,952 KB
testcase_10 AC 596 ms
30,344 KB
testcase_11 AC 568 ms
30,384 KB
testcase_12 AC 229 ms
19,248 KB
testcase_13 AC 255 ms
18,860 KB
testcase_14 AC 216 ms
19,272 KB
testcase_15 AC 273 ms
19,096 KB
testcase_16 AC 244 ms
20,392 KB
testcase_17 AC 16 ms
7,988 KB
testcase_18 AC 378 ms
19,440 KB
testcase_19 AC 472 ms
25,412 KB
testcase_20 AC 167 ms
15,920 KB
testcase_21 AC 229 ms
15,804 KB
testcase_22 AC 322 ms
19,216 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], 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], k))
0