1 #include<iostream> 2 #include<string.h> 3 #include<algorithm> 4 using namespace std; 5 6 char s[1000]; 7 char s_new[2000]; 8 int p[2000]; 9 10 int Init() 11 { 12 int len = strlen(s); 13 s_new[0] = '$'; 14 s_new[1] = '#'; 15 int j = 2; 16 17 for (int i = 0; i < len; i++) 18 { 19 s_new[j++] = s[i]; 20 s_new[j++] = '#'; 21 } 22 23 s_new[j] = '