正文
增加 3 行删除 3 行
150 行未改动全部展开15115215315415515615715815916016116216316453 行未改动218219220221222223224225150 行未改动全部展开剩下的操作也都很简单了,主要难点在于 split。```cpp# include <bits/stdc++.h># define int long long# define lc(o) tr[o].l# define rc(o) tr[o].rusing namespace std;const int N = 6e6 + 5;struct FHQTreap {int l , r , rk , sz;int ql , qr;} tr[N];int n , m , q , root[N] , tot;53 行未改动split (a , a , c , x - 1);cout << tr[c].ql << "\n";merge (b , b , c) , merge (root[n + 1] , a , b);}}return 0;}```150 行未改动全部展开15115215315415515615715815916016116216316453 行未改动218219220221222223224225150 行未改动全部展开剩下的操作也都很简单了,主要难点在于 split。```cpp# include <bits/stdc++.h># define int long long# define lc(o) tr[o].l# define rc(o) tr[o].rusing namespace std;const int N = 6e6 + 5;struct FHQTreap {int l , r , rk , sz;int ql , qr;} tr[N];int n , m , q , root[N] , tot;53 行未改动split (a , a , c , x - 1);cout << tr[c].ql << "\n";merge (b , b , c) , merge (root[n + 1] , a , b);}}return 0;}```