[luoguP2957] [USACO09OCT]谷仓里的回声Barn Echoes(Hash)


传送门

团队里的hash水题,数据小的不用hash都能过。。

也就是前缀hash,后缀hash,再比较一下就行。

——代码

1 #include <cstdio> 2 #include <cstring> 3 #define ULL unsigned long long 4 5 int n, m, ans; 6 char s1[81], s2[81]; 7 ULL base[81], sum1[81], sum2[81], bit1[81], bit2[81]; 8 9 inline int max(int x, int y) 10 13 14 inline int min(int x, int y) 15 18 19 int main() 20
View Code



上一篇:[BZOJ3196] [Tyvj1730] 二逼平衡树(线段树 套 Splay)

下一篇:[luoguP1351] 联合权值(Dfs)


hash
Copyright © 2002-2019 k262电脑网 www.k262.cn 皖ICP备2020016292号
温馨提示:部分文章图片数据来源与网络,仅供参考!版权归原作者所有,如有侵权请联系删除!QQ:251442993 热门搜索 网站地图