版本比较
【模板】模板库
正文
增加 14 行删除 2 行
46 行未改动4748495051525354555657585960616263646566106 行未改动全部展开17317417517616516617717817918018118225 行未改动46 行未改动 b >>= 1; } return res;}ll inv(ll x, ll mod) {//求x在模mod下的逆元(mod是质数),复杂度O(log mod) return qpow(x, mod - 2, mod);}int exgcd(int a, int b, int &x, int &y) {//求ax+by=gcd(a,b)的一组特解(x,y) if (!b) { x = 1, y = 0; return a; } int d = exgcd(b, a % b, y, x); y -= a / b * x; return d;}//====================== 数据结构部分 ======================//并查集const int N = 1e6 + 10;struct DSU {106 行未改动全部展开}//====================== 字符串部分 ======================const int N = 1e6 + 10;int ans[N];void match(string s1, string s2) {//求s2在s1的全部出现位置,存在ans中 int j = 0, t = nxt[0] = -1;void KMP(string s1, string s2) {//求s2在s1的全部出现位置,存在ans中 int j = 0, t = ans[0] = -1; while (j < m) { if (t < 0 || s2[j] == s2[t]) { ans[++j] = ++t; }25 行未改动