Implementation of partially retroactive priority queue with O(log m) update time and O(log n) query time, where m — number of operations, n — size of queue in current time.
Main idea can be found in «Retroactive Data Structures» by ERIK D. DEMAINE, 2007. (a, b)-tree is replaced by cartesian tree with implicit key.
Implementation also contains visualization.