当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6054:String and String

题目描述
You are given two strings S and T ,we define the "Sval" :

1. consider the substring $T.substring(a_i\otimes ans,b_i\otimes ans)$ in the substring $S.substring(c_i\otimes ans,d_i\otimes ans)$ perfect matching.
2. assume all the positions of matching is $[x_0,y_0],[x_1,y_1]...[x_k,y_k]$ while
$T.substring(a_i\otimes ans,b_i\otimes ans)$=$S.substring(x_0,y_0)$=$S.substring(x_1,y_1)$=...=$S.substring(x_k,y_k)$ $\quad (c_i\otimes ans\leq x_i,y_i\leq d_i\otimes ans)$
3. define then $ Sval=\sum_{i=0}^{k}f[y_i]$

And Zhu thinks it's too easy and he can modify the $f[a_i\otimes ans]$ to $b_i\otimes ans$.

note:
1. the "$ans$" shows before is the answer of the last query,at first ans=0.
2. the symbol "$\otimes$" is xor in binary system
3. the index is 0-based
输入解释
The first line is an integer T($1 \leq T \leq 10$) describe the number of test cases.
Each test case begins with two strings S and T,($|S|,|T|\leq 100000,\sum{|S|+|T|}\leq 400000$,each character is lowercase letters from the alphabet).
Then a line contains $|S|$ numbers describe each element of $f$.($0 \leq f_i \leq 10000$)
The next line contains number of operators Q ($Q\leq 100000,\sum{Q}\leq 200000$).
The operators have two types:
1.modify the $f[a_i\otimes ans]$ to $b_i\otimes ans$ ($0\leq b_i\otimes ans\leq 10000$)
2.query the Sval of $T.substring(a_i\otimes ans,b_i\otimes ans)$ in $S.substring(c_i\otimes ans,d_i\otimes ans)$
The remaining Q lines contain operators in the form $t_i\ a_i\ b_i$ if $t_i=1$;$t_i\ a_i\ b_i\ c_i\ d_i$ if $t_i=2$ denoting the type of the operators and the parameters respectively.
输出解释
For each query output one integer which means the answer.
输入样例
1
aaaa
aaaa
0 1 2 3
3
2 0 0 0 3
1 6 3
2 6 6 6 5
输出样例
6
11
来自杭电HDUOJ的附加信息
Recommend liuyiding

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6054

最后修改于 2020-10-25T23:27:54+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
6000/3000MS(Java/Others) 262144/262144K(Java/Others)