https://blog.csdn.net/csyifanZhang/article/details/106391657
推导过程↑
#define ll long long
#define vec vector<int>
#define inf 0x3f3f3f3f
#define MAX 100005
#define P pair<ll,ll>
#define MOD 1000000
int main() {
string s;
int s1[MAX], s2[MAX], s3[MAX];/...