摘要: AtCoder abc470 F - Googol Swaps 分析 先考虑没有严格操作 \(10^{100}\) 次限制的方案数。 \(m\) 个可以交换的位置 \(A_i\) 和 \(B_i\)(\(i \in [1, m]\)),其实相当于在一个 \(n\) 个点的图上的 \(m\) 条边,在 阅读全文
posted @ 2026-08-09 13:32 acceptedK77 阅读(7) 评论(0) 推荐(0)
摘要: AC 自动机 DP 模板 以及矩阵快速幂优化线性递推 DP。 本篇主要讲矩阵快速幂优化线性递推 DP。 题目 NOIP3-T2 佩绣-ACGO 题意 给 \(m\) 个由小写英文字母构成的字符串 \(S_i\),确定在长度不超过 \(n\) 的字符串 \(T\) 满足 \(T\) 的任意子串都不等于 阅读全文
posted @ 2026-08-08 14:25 acceptedK77 阅读(4) 评论(0) 推荐(0)
摘要: 树上启发式合并模板 #include<bits/stdc++.h> using namespace std; const int maxn=2e6+5; vector<int> e[maxn]; int n; int L[maxn],R[maxn],dfn[maxn],node[maxn],cur, 阅读全文
posted @ 2026-06-14 18:39 acceptedK77 阅读(8) 评论(0) 推荐(0)