結果
| 問題 |
No.2453 Seat Allocation
|
| コンテスト | |
| ユーザー |
timi
|
| 提出日時 | 2023-09-01 22:35:04 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 1,165 ms / 2,000 ms |
| コード長 | 435 bytes |
| コンパイル時間 | 447 ms |
| コンパイル使用メモリ | 11,904 KB |
| 実行使用メモリ | 42,660 KB |
| 最終ジャッジ日時 | 2025-06-20 01:45:40 |
| 合計ジャッジ時間 | 12,352 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
ソースコード
N,M=map(int, input().split())
A=list(map(int, input().split()))
B=list(map(int, input().split()))
from decimal import Decimal
b=B[0]
import heapq
C=[];e=10**40
for i in range(N):
x=-(e*A[i]-i)
c=Decimal(x)/Decimal(b)
heapq.heappush(C,(c,i,0))
#print(C)
for _ in range(M):
c,i,r=heapq.heappop(C)
print(i+1)
if r+1==M:
continue
x=-(e*A[i]-i)
cc=Decimal(x)/Decimal(B[r+1])
heapq.heappush(C,(cc,i,r+1))
#print(C)
timi