首先看我對kmp解決周期、首碼與尾碼間關係的解釋http://www.cnblogs.com/wuyiqi/archive/2012/01/06/2314078.htmlhdu 3336 count the string題意:求給定字串含首碼的數量abab首碼為aababaabababab中共有六個子串是首碼a a ab ab aba abab所以答案為6利用kmp中的匹配原理可以完美的解決此題 a---------d----- -----a---------d
CipherTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 16995 Accepted: 4445DescriptionBob and Alice started to use a brand-new encoding scheme. Surprisingly it is not a Public Key Cryptosystem, but their encoding and decoding is based on
Wireless PasswordTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2189 Accepted Submission(s): 610Problem DescriptionLiyuan lives in a old apartment. One day, he suddenly found that there was
PyramidsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2268 Accepted: 751 Special JudgeDescriptionRecently in Farland, a country in Asia, a famous scientist Mr. Log Archeo has discovered ancient pyramids. But unlike those in Egypt and
Manhattan WiringTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 1110 Accepted: 634DescriptionThere is a rectangular area containing n × m cells. Two cells are marked with “2”, and another two with “3”. Some cells are occupied by obstacles.
Round NumbersTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 6051 Accepted: 2050DescriptionThe cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone' (also known as 'Rock, Paper, Scissors', 'Ro,
Probability OneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 301 Accepted Submission(s): 224Problem DescriptionNumber guessing is a popular game between elementary-school kids. Teachers