版本比较
CSP-S 2025 整理
正文
增加 3 行删除 3 行
126 行未改动全部展开12712812913013113213313413526 行未改动162163164165166167168169170171172173174175176219 行未改动全部展开126 行未改动全部展开f[fu] = fv; tmp += w;}}lchkmn(ans, tmp);}cout << ans << "\n";}```26 行未改动::::info[Code(没有写双模哈希,会被卡)]```cppconst int maxv = 5e6 + 5, maxn = 2e5 + 5;int n, q;const ll Base = 233, mod = 1e9 + 7;ll b[maxv], hsh1[maxv], hsh2[maxv];void init(){b[0] = 1;for(int i = 1; i < maxv; i++) b[i] = b[i - 1] * Base % mod;}ll getHsh(string str, ll *hsh){int l = str.size();for(int i = 1; i <= l; i++) hsh[i] = (hsh[i - 1] * Base + str[i - 1]) % mod;219 行未改动全部展开126 行未改动全部展开12712812913013113213313413526 行未改动162163164165166167168169170171172173174175176219 行未改动全部展开126 行未改动全部展开f[fu] = fv; tmp += w;}}lchkmn(ans, tmp);}cout << ans << "\n";}```26 行未改动::::info[Code(没有写双模哈希,会被卡)]```cppconst int maxv = 5e6 + 5, maxn = 2e5 + 5;int n, q;const ll Base = 233, mod = 1e9 + 7;ll b[maxv], hsh1[maxv], hsh2[maxv];void init(){b[0] = 1;for(int i = 1; i < maxv; i++) b[i] = b[i - 1] * Base % mod;}ll getHsh(string str, ll *hsh){int l = str.size();for(int i = 1; i <= l; i++) hsh[i] = (hsh[i - 1] * Base + str[i - 1]) % mod;219 行未改动全部展开