水题。 #pragma GCC optimize(2) #include <bits/stdc++.h> #define endl '\n' #define ll long long using namespace std; ll tree[1000050],a[1000050],n,m,ans,x; ll lowbit(ll x) { return x&-x; } void add(ll i,ll x) { while(i<=n*n) { tree[i]+=x; i+=lowbit(i); ...