結果

問題 No.2453 Seat Allocation
ユーザー Akijin_007Akijin_007
提出日時 2023-09-01 22:07:41
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 456 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 86,852 KB
実行使用メモリ 113,504 KB
最終ジャッジ日時 2023-09-02 11:12:16
合計ジャッジ時間 8,667 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,316 KB
testcase_01 AC 75 ms
71,632 KB
testcase_02 AC 77 ms
71,516 KB
testcase_03 AC 74 ms
71,256 KB
testcase_04 AC 76 ms
71,420 KB
testcase_05 AC 453 ms
113,176 KB
testcase_06 AC 190 ms
93,856 KB
testcase_07 AC 217 ms
93,992 KB
testcase_08 AC 157 ms
79,900 KB
testcase_09 AC 639 ms
113,376 KB
testcase_10 AC 611 ms
113,416 KB
testcase_11 AC 643 ms
113,504 KB
testcase_12 AC 198 ms
93,364 KB
testcase_13 AC 242 ms
92,920 KB
testcase_14 AC 148 ms
93,044 KB
testcase_15 AC 284 ms
93,104 KB
testcase_16 AC 230 ms
92,748 KB
testcase_17 AC 75 ms
71,404 KB
testcase_18 AC 476 ms
97,420 KB
testcase_19 AC 550 ms
106,092 KB
testcase_20 AC 280 ms
86,872 KB
testcase_21 AC 309 ms
88,056 KB
testcase_22 AC 427 ms
94,892 KB
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))


N, M = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split())) + [10 ** 9]

ans = []
import heapq
q = []
for i in range(N):
    q.append((-A[i] / B[0], i, 0))

heapq.heapify(q)
for i in range(M):
    s, j, k = heapq.heappop(q)
    ans.append(j+1)
    heapq.heappush(q, (-A[j] / B[k+1], j, k+1))

for i in range(M):
    print(ans[i])





0