原创 字符串Hash:各種字符串Hash函數比較

轉載自:https://www.byvoid.com/blog/string-hash-compare/ 常用的字符串Hash函數還有ELFHash,APHash等等,都是十分簡單有效的方法。這些函數使用位運算使得每一個字符都對最後的

原创 [計算幾何]poj 2308 Toys

#include <cstdio> #include <cstring> #include <algorithm> #include <iostream> #include <queue> using namespace std; str

原创 Hash練習題:【HDOJ4821】--String【字符串hash】

來源:http://acm.hdu.edu.cn/showproblem.php?pid=4821 另外有一道簡單的可以先做:http://acm.hdu.edu.cn/showproblem.php?pid=1800 String

原创 字符串練習題:【CF235C】 Cyclical Quest(SAM )

來源:http://codeforces.com/contest/235/problem/C 題目:給出一個串S,一個串T。S中有多少個串可以通過“處理”得到串T。            處理是指,將串分成兩部分,調換順序 CL

原创 字符串練習題:SPOJ 220 Relevant Phrases of Annihilation(後綴數組加二分)

轉載請註明出處,謝謝http://blog.csdn.net/acm_cxlove/article/details/7854526       by---cxlove 題目:給定n個字符串,求出每個字符串至少出現兩次且不重疊的最長子串 

原创 [BFS+狀壓]poj 1184 Smart typist

#include <iostream> #include <queue> #include <cstring> #include <cmath> #include <algorithm> using namespace std; co

原创 圖論練習題:【BZOJ2753 || SCOI2012】滑雪與時間膠囊

來源:http://www.lydsy.com/JudgeOnline/problem.php?id=2753 Description a180285非常喜歡滑雪。他來到一座雪山,這裏分佈着M條供滑行的軌道和N個軌道之間的交點(同時也

原创 [半平面交] poj 3384 Feng Shui

#include <cstdio> #include <cstring> #include <cmath> #include <algorithm> const double eps = 1e-8; inline double del

原创 Hash練習題:【213E】 Two Permutations(線段樹,hash)

文章出處: http://blog.csdn.net/ACM_cxlove?viewmode=contents 原題:http://codeforces.com/problemset/problem/213/E 尼瑪,這是研

原创 SG專題:博弈專題總結

來源:http://blog.csdn.net/acm_cxlove/article/details/7854530 以下是我從網上收集的關於組合博弈的資料彙總: 有一種很有意思的遊戲,就是有物體若干堆,可以是火柴棍或是圍棋子等等

原创 字符串練習題:【CF119D】 String Transformation(KMP或哈希,枚舉,各種優化)

出處:http://blog.csdn.net/ACM_cxlove?viewmode=contents    by---cxlove   題目:有兩個串,s,f  f(s, i, j) = s[i + 1... j - 1] + r(

原创 字符串練習題:H - Another String Game

來源:Sichuan State Programming Contest 2014 Final H - Another String Game Time Limit: 3000/1000MS (Java/Others)     M

原创 組合數學專題:Polya計數原理及其應用,模板題【poj2409】

Polya定理參見:http://wenku.baidu.com/view/bf92a95f804d2b160b4ec0be.html?re=view Polya定理練習題總結:http://blog.csdn.net/acm_cxlo

原创 poj 1201 Intervals [差分約束]

#include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int MAXN = 50010; struct Ran

原创 【HDOJ4436】 a.k.a 天津2012 F

來源:http://acm.hdu.edu.cn/showproblem.php?pid=4436 HDOJ 4436 a.k.a 天津2012 F 【題意】 給定N個數字串,每個串的子串成一個數字,問這些數字放進一個set裏面去