/* TODO: - add lower_bound and upper_bound - find index of node (any, first, last) - persistency */ BYOT!

Build your own treap!

Usage: click on stuff u want, don't click on stuff you don't want.
You can right click a disabled checkbox/dropdown to enable all its prerequisites.
Half this site is written by ChatGPT so don't judge too harshly.
If you have any suggestions or find any bugs (highly likely), leave a comment on the blog.

See the codeforces blog post for usage examples.

Basic treap    Array-based treap















































































Warnings:

mt19937 mt(chrono::steady_clock::now().time_since_epoch().count());
using ptr = struct Node*;

struct Node {

    int pri;
    ptr l, r;

    Node() {
        pri = mt();
        l = r = nullptr;
    }

    ~Node() {
        delete l;
        delete r;
    }
};