3930. Power Update After K-th Largest Insertion II
ArrayHash TableMathSegment TreeSorting
Hints
Hint 1
Convert
kth largest into rank size - k + 1 in increasing order.Hint 2
Use coordinate compression + Fenwick tree to find that ranked value efficiently.
Hint 3
Update
p with fast modular exponentiation.Preparing judge…