题解:gi(pq=pqi-pqi+di 至于为什么,可以看看往上的题解 代码: #include<bits/stdc++.h> using namespace std; typedef long long ll; ,D=,q=1e9+; ll p[N],s[N],a[D][D],as[N]; ll read() { ll x=;char c; ';c=getchar()); +c-; return x; } ll ksm(ll x,ll y) { ll ret=; ,(x*=x)%=q) )(…