摘要: #include <iostream> using namespace std; // 定义最大节点数量,限制树的规模 const int N = 100005; // 定义Treap树的节点结构 struct node { int l, r; // 左右儿子的索引(0表示空节点) int val; 阅读全文