摘要:
题目链接:https://www.luogu.com.cn/problem/P3193 解题思路: 建立完 KMP 的 nxt 数组之后(其实也可以建状态机,但是 \(m \le 20\) 所以建 状态机 并不是必要的),构造一个转移矩阵。然后矩阵乘法优化,就能够得到答案了。 #include <b 阅读全文
posted @ 2026-05-21 20:53
quanjun
阅读(5)
评论(0)
推荐(0)
摘要:
题目链接:https://www.luogu.com.cn/problem/P4345 解题思路: 示例程序: #include <bits/stdc++.h> using namespace std; using ll = long long; const ll p = 2333; ll c[p+ 阅读全文
posted @ 2026-05-21 16:53
quanjun
阅读(1)
评论(0)
推荐(0)
浙公网安备 33010602011771号