Problem 3930 · Hard

Power Update After K-th Largest Insertion II

Insert each value into a sorted list, pick the k-th largest element with duplicates counted, and raise p to that power modulo 1000000007.

Open the interactive visualisation