From 3915560ceadb4a5de56aaf3f743eb5a073b3fa8e Mon Sep 17 00:00:00 2001 From: bala <13452927+rfgsdhshgfh@user.noreply.gitee.com> Date: Sat, 13 Jan 2024 15:06:02 +0000 Subject: [PATCH] =?UTF-8?q?=E5=88=A9=E7=94=A8KMP=E7=AE=97=E6=B3=95?= =?UTF-8?q?=E6=B1=82=E5=AD=90=E4=B8=B2=E5=9C=A8=E4=B8=BB=E4=B8=B2=E4=B8=AD?= =?UTF-8?q?=E4=B8=8D=E9=87=8D=E5=8F=A0=E5=87=BA=E7=8E=B0=E7=9A=84=E6=AC=A1?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: bala <13452927+rfgsdhshgfh@user.noreply.gitee.com> --- ...0\347\232\204\346\254\241\346\225\260.cpp" | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 "2224020152/\347\254\254\345\233\233\345\215\225\345\205\203/\345\210\251\347\224\250KMP\347\256\227\346\263\225\346\261\202\345\255\220\344\270\262\345\234\250\344\270\273\344\270\262\344\270\255\344\270\215\351\207\215\345\217\240\345\207\272\347\216\260\347\232\204\346\254\241\346\225\260.cpp" diff --git "a/2224020152/\347\254\254\345\233\233\345\215\225\345\205\203/\345\210\251\347\224\250KMP\347\256\227\346\263\225\346\261\202\345\255\220\344\270\262\345\234\250\344\270\273\344\270\262\344\270\255\344\270\215\351\207\215\345\217\240\345\207\272\347\216\260\347\232\204\346\254\241\346\225\260.cpp" "b/2224020152/\347\254\254\345\233\233\345\215\225\345\205\203/\345\210\251\347\224\250KMP\347\256\227\346\263\225\346\261\202\345\255\220\344\270\262\345\234\250\344\270\273\344\270\262\344\270\255\344\270\215\351\207\215\345\217\240\345\207\272\347\216\260\347\232\204\346\254\241\346\225\260.cpp" new file mode 100644 index 00000000..d28da165 --- /dev/null +++ "b/2224020152/\347\254\254\345\233\233\345\215\225\345\205\203/\345\210\251\347\224\250KMP\347\256\227\346\263\225\346\261\202\345\255\220\344\270\262\345\234\250\344\270\273\344\270\262\344\270\255\344\270\215\351\207\215\345\217\240\345\207\272\347\216\260\347\232\204\346\254\241\346\225\260.cpp" @@ -0,0 +1,80 @@ +#include +using namespace std; +const int N =1e6; +int lps[N]; +int nt[N]; +void get_lps(string t,int *lps) +{ + int m=t.size(); + int i=1,j=0; + lps[0]=0; + while(i>s>>t; + cout<