roblem Description
You are given two strings S and T ,we define the "Sval" :
1. consider the substring T.substring(ai⊗ans,bi⊗ans) in the substring S.substring(ci⊗ans,di⊗ans) perfect matching.
2. assume all the positions of matching is [x0,y0],[x1,y1]...[xk,yk] while
T.substring(ai⊗ans,bi⊗ans)=S.substring(x0,y0)=S.substring(x1,y1)=...=S.substring(xk,yk) (ci⊗ans≤xi,yi≤di⊗ans)
3. define then Sval=∑ki=0f[yi]
And Zhu thinks it's too easy and he can modify the f[ai⊗ans] to bi⊗ans.
note:
1. the "ans" shows before is the answer of the last query,at first ans=0.
2. the symbol "⊗" is xor in binary system
3. the index is 0-based
1. consider the substring T.substring(ai⊗ans,bi⊗ans) in the substring S.substring(ci⊗ans,di⊗ans) perfect matching.
2. assume all the positions of matching is [x0,y0],[x1,y1]...[xk,yk] while
T.substring(ai⊗ans,bi⊗ans)=S.substring(x0,y0)=S.substring(x1,y1)=...=S.substring(xk,yk) (ci⊗ans≤xi,yi≤di⊗ans)
3. define then Sval=∑ki=0f[yi]
And Zhu thinks it's too easy and he can modify the f[ai⊗ans] to bi⊗ans.
note:
1. the "ans" shows before is the answer of the last query,at first ans=0.
2. the symbol "⊗" is xor in binary system
3. the index is 0-based