結果
| 問題 | No.2453 Seat Allocation |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-09-01 23:09:56 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 433 bytes |
| 記録 | |
| コンパイル時間 | 129 ms |
| コンパイル使用メモリ | 82,092 KB |
| 実行使用メモリ | 113,896 KB |
| 最終ジャッジ日時 | 2026-10-10 12:15:04 |
| 合計ジャッジ時間 | 6,701 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 WA * 6 |
ソースコード
from heapq import heappop,heappush
n,m = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
inf = 10**10
h = []
num = [0]*n
for i in range(n):
heappush(h,[-inf*A[i]//B[0],i])
ans = []
for _ in range(m):
x,ind = heappop(h)
ans.append(ind+1)
num[ind] += 1
if num[ind] >= m:
continue
heappush(h,[-inf*A[ind]//B[num[ind]],ind])
for i in ans:
print(i)