[AcWing 1052] 设计密码
https://img2022.cnblogs.com/blog/2674359/202206/2674359-20220624224439846-665412683.pnghttps://img2022.cnblogs.com/blog/2674359/202206/2674359-20220624224452948-278636365.png
KMP + 状态机
点击查看代码#include#include#include#includeusing namespace std;const int N = 60;const int mod = 1e9 + 7;int n;char str;int ne;int f;int main(){ cin >> n >> str + 1; int m = strlen(str + 1); for (int i = 2, j = 0; i
页:
[1]