結果
問題 |
No.2453 Seat Allocation
|
ユーザー |
![]() |
提出日時 | 2023-09-02 17:30:00 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 814 bytes |
コンパイル時間 | 782 ms |
コンパイル使用メモリ | 82,244 KB |
実行使用メモリ | 108,800 KB |
最終ジャッジ日時 | 2024-06-11 23:59:25 |
合計ジャッジ時間 | 6,554 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 WA * 3 |
ソースコード
############################################################# import sys sys.setrecursionlimit(10**7) from heapq import heappop,heappush from collections import deque,defaultdict,Counter from bisect import bisect_left, bisect_right from itertools import product,combinations,permutations ipt = sys.stdin.readline def iin(): return int(ipt()) def lmin(): return list(map(int,ipt().split())) MOD = 998244353 L = 10**15 ############################################################# N,M = lmin() A = lmin() B = lmin() cnt = [1]*N hq = [] for i,a in enumerate(A): heappush(hq,(-a/B[0]*L+i,i)) ans = [] while len(ans) < M: _,idx = heappop(hq) ans.append(idx+1) if cnt[idx] >= M: break heappush(hq,(-A[idx]/B[cnt[idx]]*L+idx,idx)) cnt[idx] += 1 for a in ans: print(a)