I_Love_Hanh_Trinh's blog

By I_Love_Hanh_Trinh, history, 9 years ago, In English

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) and 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.)

Full text and comments »

By I_Love_Hanh_Trinh, 9 years ago, In English

Hi everybody, Now, I'm trying to solve this problem in SPOJ (Here link). But i don't have any idea. Can someone help me, pls? Thanks.

Full text and comments »