Fhq-Treap. // Fhq-Treap const int MAXN = 1e5 + 5; struct Fhq_Treap { #define Lson Tr[p].l #define Rson Tr[p].r struct Fhq_Node { int l, r, Val, Key, Size; Fhq_Node () {} Fhq_Node (int L, int R, int V, int K, int S) { l = L, r = R, Val = V, Key = K, S…