結果

問題 No.2453 Seat Allocation
ユーザー lloyzlloyz
提出日時 2023-09-04 01:11:32
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 367 bytes
コンパイル時間 1,164 ms
コンパイル使用メモリ 86,888 KB
実行使用メモリ 109,592 KB
最終ジャッジ日時 2023-09-04 01:11:45
合計ジャッジ時間 10,885 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,188 KB
testcase_01 AC 74 ms
71,336 KB
testcase_02 AC 75 ms
71,136 KB
testcase_03 AC 74 ms
71,468 KB
testcase_04 AC 72 ms
71,324 KB
testcase_05 AC 480 ms
109,592 KB
testcase_06 AC 189 ms
91,588 KB
testcase_07 AC 186 ms
95,196 KB
testcase_08 AC 142 ms
79,036 KB
testcase_09 AC 626 ms
104,216 KB
testcase_10 AC 588 ms
104,152 KB
testcase_11 AC 592 ms
104,260 KB
testcase_12 AC 202 ms
91,264 KB
testcase_13 AC 247 ms
91,632 KB
testcase_14 AC 142 ms
91,248 KB
testcase_15 AC 291 ms
91,788 KB
testcase_16 AC 263 ms
90,768 KB
testcase_17 AC 78 ms
71,180 KB
testcase_18 AC 437 ms
98,620 KB
testcase_19 AC 475 ms
101,840 KB
testcase_20 AC 271 ms
86,012 KB
testcase_21 AC 288 ms
86,776 KB
testcase_22 AC 380 ms
93,644 KB
testcase_23 WA -
testcase_24 AC 73 ms
71,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heappop, heappush

n, m = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

H = []
for i in range(n):
    heappush(H, (-A[i] / B[0], i, 0))
for _ in range(m):
    _, ans, idx = heappop(H)
    print(ans + 1)
    idx += 1
    if idx == m:
        continue
    heappush(H, (-A[ans] / B[idx], ans, idx))
0