String Problem

Revision en1, by I_Love_Hanh_Trinh, 2015-08-03 21:15:49

Hi everybody! Now I'm trying to solve a problem but i don't have any idea. Can someone help me, please? I'm thanks. Problem: Given your string S and function F(S, i, j) = S(i + 1, j — 1) + rev(S(j, n)) + rev(S(1, i)) With + S(i, j) is substring S[i...j] (if i > j, string is empty) + rev(S(i, j)) reverse of substring S[i..j] Now, given you 2 strings A and B are same length, you task to count pair i and j (1 <= i <= j <= n) so that F(A, i, j) = B. Length of string A and B <= 3*10^5. (My English is not good, Sorry)

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English I_Love_Hanh_Trinh 2015-08-03 21:18:33 26
en2 English I_Love_Hanh_Trinh 2015-08-03 21:16:43 0 Tiny change: 'ng S[i..j]\nNow, given' -> 'ng S[i..j]Now, given'
en1 English I_Love_Hanh_Trinh 2015-08-03 21:15:49 551 Initial revision (published)