最長迴文字串(hdu 3068)

原題鏈接http://acm.hdu.edu.cn/showproblem.php?pid=3068 查找字符串中最長的迴文串,我們用到manachar算法。 要實現manachar算法我們有有兩步要做 1:對字符串進行處理,把所有的字符串的長度統一化爲奇數。。 1 int l=0; 2 int ans=0; 3 Ma[l++]='$'; 4 Ma[l++]='#
相關文章
相關標籤/搜索