摘要:
A 略 B 记录每种字母的出现次数前缀和,然后p[i][j]表示字母j出现至少i次的最靠前的位置,然后直接搜取最大即为答案,O(26(n+m)+Σ|ti|),差点想到二分去了,复杂度会多个log #include<bits/stdc++.h> using namespace std; const i 阅读全文
摘要:
A 略 B 被删了,被这个假题搞自闭了,显然没做出来。 C 开始莽了个NTT,后来发现会TLE,其实是个SB前缀和,对于这题,我无**说。 #include<bits/stdc++.h> using namespace std; const int N=1e6+7,mod=998244353; in 阅读全文
摘要:
这场和div3差不多嘛(后来发现就是div3),就是网太卡10min交一发就不错了,简直自闭。 A 签到。 B 记录每一段的字母数,满足条件即:段数相同+字母相同+字母数下>=上。 #include<bits/stdc++.h> using namespace std; const int N=1e 阅读全文