题解: splay维护 注意是gcd 代码: #include<bits/stdc++.h> using namespace std; #define Key_value ch[ch[root][1]][0] ; ]; ],key[N],size[N],root,tot1,L,R,pos,_st,val; int sum0[N],sum1[N],st[N],s[N],tot2,a[N],status[N],n,q; int gcd(int a,int b) { if (!b)return a;…