线下蒟蒻由于被i题整红温导致措施写主席树的机会 #include<bits/stdc++.h> #define int long long using namespace std; const int maxn=2e5+10; int a[maxn],bb[maxn],root[maxn],sz; int r[maxn],t[maxn]; struct tree { int l,r,cnt,sum,val; }tr[maxn<<5]; void build(int& now,int l,int r) { ++sz; now=sz; tr[now].s...