結果
問題 | No.2453 Seat Allocation |
ユーザー |
![]() |
提出日時 | 2023-09-01 22:27:36 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 360 bytes |
コンパイル時間 | 283 ms |
コンパイル使用メモリ | 82,560 KB |
実行使用メモリ | 107,596 KB |
最終ジャッジ日時 | 2025-01-03 09:36:14 |
合計ジャッジ時間 | 9,016 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 WA * 5 |
ソースコード
N,M=map(int, input().split()) A=list(map(int, input().split())) B=list(map(int, input().split())) b=B[0] import heapq C=[];e=10**15 for i in range(N): c=-(e*A[i]-i)/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 cc=-(e*A[i]-i)/B[r+1] heapq.heappush(C,(cc,i,r+1)) #print(C)