随笔分类 - hash
摘要:Miku hash一波 然后拉链法散列表 #include<iostream> #include<cstdio> #include<cmath> #include<vector> #include<algorithm> using namespace std; template<class T>in
阅读全文
摘要:Miku 这个题可以用树hash做 怎么搞呢,对于一棵树,我们要用hash记录他的形态 对于二叉树,我们要记录的就是左儿子的hash和自己和右儿子。 然后进行比较 我采用的是对于左右儿子和自己乘上不同质数的方式 还有自然溢出,以及两次hash #include<iostream> #include<
阅读全文
摘要:链接:Miku 思路简单,双向bfs,实现困难 #include<iostream> #include<cstring> #include<cstdio> #include<algorithm> using namespace std; const int maxn=100003; int f,an
阅读全文
摘要:链接:Miku #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; const unsigned long long k=131,imp=1e7+1; unsig
阅读全文