Author: Benjamin Qi
Tree Rotations 2 Solution
This CF post describes a more general version of the problem above.
- For speed / memory, use arrays of fixed size rather than pointers.
IOI 2013 Game - https://oj.uz/submission/242393
Join the USACO Forum!
Stuck on a problem, or don't understand a module? Join the USACO Forum and get help from other competitive programmers!
Give Us Feedback on Treaps!
Leave suggestions for us by making a post on the USACO Forum! Ex: Unclear sections, mislabeled problems, etc.