結果
| 問題 |
No.2453 Seat Allocation
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-09-01 22:07:41 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 456 bytes |
| コンパイル時間 | 159 ms |
| コンパイル使用メモリ | 82,564 KB |
| 実行使用メモリ | 110,796 KB |
| 最終ジャッジ日時 | 2024-06-11 17:52:01 |
| 合計ジャッジ時間 | 6,488 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 WA * 1 |
ソースコード
#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])