Problem 3935 · Medium

Power Update After K-th Largest Insertion I

After each insert, take the k-th largest element with duplicates counted and raise p to that power modulo 1000000007.

Open the interactive visualisation