![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Hash
文章平均质量分 80
BraketBN
这个作者很懒,什么都没留下…
展开
-
【BZOJ1056】[HAOI2008]排名系统【Splay】【Hash】
【题目链接】题不难,就是写得累。注意题面有误,score需要LL,而且可能为0。懒得写hash就用了个map。/* Footprints In The Blood Soaked Snow */#include #include #include #include #include using namespace std;typedef long long原创 2016-03-29 19:07:13 · 453 阅读 · 0 评论 -
【BZOJ1862】[Zjoi2006]GameZ游戏排名系统【Splay】【Hash】
【题目链接】同【BZOJ1862】/* Footprints In The Blood Soaked Snow */#include #include #include #include #include using namespace std;typedef long long LL;const int maxn = 1000005;const LL inf =原创 2016-03-29 19:08:10 · 360 阅读 · 0 评论 -
【BZOJ3555】[Ctsc2014]企鹅QQ【Hash】
【题目链接】姿势get√,判断一堆字符串是否相同,可以先hash,再按hash排序判断...这样复杂度从O(n^2L)降为O(L+nlogn+n)/* Pigonometry */#include #include using namespace std;typedef unsigned long long ULL;const int maxn = 30005, max原创 2016-04-01 09:43:52 · 438 阅读 · 0 评论 -
【BZOJ1014】[JSOI2008]火星人prefix【Splay】【Hash】
http://www.lydsy.com/JudgeOnline/problem.php?id=1014学习一发树上Hash。10s卡时过了。/* Footprints In The Blood Soaked Snow */#include #include #include using namespace std;typedef long long LL;c原创 2016-03-20 19:21:57 · 366 阅读 · 0 评论 -
【BZOJ2803】[Poi2012]Prefixuffix【Hash】【单调性】
【题目链接】考虑两个字符串str1、str2是循环相同的,那么这两个字符串可以表示成str1 = s1 + s2和str2 = s2 + s1的形式,。比如ababba和abbaab,s1 = ab,s2 = abba。那么在一个大字符串中,s1和s2其中一个一定是这个字符串的前后缀,假设为s1,那么我们可以枚举s1的长度,然后去判断s2是否相等,这个可以用hash。发现s2为原创 2016-04-07 12:05:26 · 529 阅读 · 0 评论 -
【BZOJ1054】[HAOI2008]移动玩具【BFS】【Hash】
【题目链接】大暴搜...hash去重一下就行。搜到答案时候直接输出是因为BFS时队列前的状态步数是最小的。/* Footprints In The Blood Soaked Snow */#include #include using namespace std;const int maxn = 7, maxq = 1 << 17, inf = 0x3f3f3f3f;c原创 2016-03-27 22:15:28 · 475 阅读 · 0 评论 -
【BZOJ2795】[Poi2012]A Horrible Poem【Hash】【GCD】【暴力】
【题目链接】【POPOQQQ的题解】跑了倒数rk5.../* Think Thank Thunk */#include #include #include using namespace std;typedef long long LL;typedef unsigned long long ULL;const int maxn = 500005;int n,原创 2016-07-14 12:12:20 · 735 阅读 · 0 评论