KMP【整理】

來源:互聯網
上載者:User

學習資料

【KMP】Matrix67: http://www.matrix67.com/blog/archives/115

【拓展KMP】劉雅瓊ppt: http://wenku.baidu.com/view/8e9ebefb0242a8956bece4b3.html

【淺析“最小標記法”思想在字串迴圈同構問題中的應用--03 周源】:1.論文   2.ppt


kmp暫時告一段落,做了剛好一個星期,收集的各種Google加Baidu刨出來的KMP題目。還有兩題目前還沒想法,說不定哪天突然靈感來了再補上。


HDU 1711  Number Sequence                          模板題

HDU 1686  Oulipo                                             模板題

HDU 2087  剪花布條                                         KMP模板題,也可直接用strstr暴力

HDU 3068  最長迴文                                           

HDU 4300  Clairewd’s message                        拓展KMP, 這題用暴力(不用任何演算法)也可水過

HDU 2594  Simpsons’ Hidden Talents              用KMP尋找s2中的s1串,最後一個狀態值j表示的就是最長的s2的尾碼與s1的首碼。

HDU 3746  Cyclic Nacklace                               最短迴圈節(字串後面添加x個字元,讓x最小,使其由某個首碼子串至少迴圈2次構成的)

HDU 1358  Period                                             最短迴圈節 

HDU 2203  親和串                                             迴圈移位相當於把數組擴大成兩倍,再KMP匹配

HDU 3613  Best Reward                                   拓展KMP求首碼迴文

HDU 3374  String Problem                                最小最大標記法+KMP
HDU 3336  Count the string                               經典, KMP+DP

HDU 4333  Revolving Digits                              拓展KMP



HUST 1010  The Minimum Length                    轉換成求最短迴圈節

HUST 1328  String                                            同HDU3336

XDU 1154 大黃的選票                                       找到首碼位置,用dp[i]表示i之前有多少個首碼,然後再找尾碼。注意首碼的開頭一定要在尾碼之前。

FZU  1901  Period II                                          KMP或拓展KMP

CF149E  Martian Strings                                  先找到匹配串首碼在原串中最左邊的位置,然後找尾碼的位置是否在這個位置之後。

CF182D  Common Divisors                              最短迴圈節,迴圈節周期

CF 126B  Password                                                       Next數組

poj 1226  Substrings                                         水。同poj3080
poj 2185  Milking Grid               
poj 2406  Power Strings                                    最短迴圈節  
poj 2541  Binary Witch                                      逆序轉換原字串,變成求最長公用首碼(即使這樣也是資料太水才過的,正解是狀態壓縮dp)

poj 2752  Seek the Name, Seek the Fame        理解失配函數!

poj 3080  Blue Jeans                                        枚舉所有子串,看能否全部序列都匹配   

poj 3450  Corporate Identity                             同poj 3080

poj 3167  Cow Patterns

poj 3461  Oulipo                                                同hdu 1686

zoj 3587   Marlon's String                                   拓展KMP+dp 


 ——  生命的意義,在於賦予它意義士。

          原創 http://blog.csdn.net/shuangde800 , By
  D_Double  (轉載請標明)


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.