for(int i = 2, k = 0; i <= n; ++ i) { while(1) { if(s[k + 1] == s[i]) { ne[i] = ++ k; break; } if(!k) break; k = ne[k]; } }
我这么求 border 为啥暴毙了