学到了好多东西啊这题... https://blog.csdn.net/sdfzyhx/article/details/72968468 #include<bits/stdc++.h> using namespace std; ,mod=1e9+; typedef long long ll; ll miu[N],v[N],p[N],cnt,sum1[N],sum2[N],mi1[N],mi2[N],h[N],g[N],f[N],T,n; ll inc(ll a,ll b) { a=a+b; i…