字符串字符串哈希On this page字符串哈希参考资料 字符串哈希 - OI Wiki 实现 197 Bcppusing ull=unsigned long long;const int base=131;const ull mod=212370440130137957;ull get_hash(string s){ ull res=0; for(int i=0;i<s.size();i++) { res=(res*base+s[i])%mod; } return res;} 例题 Problemcode洛谷 P3370 【模板】字符串哈希如题,给定 NNN 个字符串(第 iii 个字符串长度为 MiM_iMi,字符串内包含数字、大小写字母,大小写敏感),请求出 NNN 个字符串中共有多少个不同的字符串。 Problemcode洛谷 U461211 字符串 Hash(数据加强)给定 nnn 个字符串,判断不同的字符串有多少个。