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

建议使用的浏览器:

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

4867:Xor

题目描述
Given n non-negative integers, We define a statistical function as follows:

It will be noted that the nature of F(k) is calculated with the number of choices, such that:
1)0≤bi≤ai,0≤i≤n-1,bi is a integer.
2)b0 xor b1 xor ... xor bn-1 = k,xor means exclusive-or operation.  
Now given A and m operations, there are two different operations:
1)C x y: set the value of ax to y;
2)Q x: calculate F(x) mod P, where P = 1000000007.
输入解释
The first line has a number T (T ≤ 10), indicating the number of test cases.
For each test case, the first line contains tow integers n, m, (1≤n, m≤20000), denote the n, m that appear in the above description. Then next line contains n non-negative integers denote
(0≤ai≤1000).
Then next m lines. Each line is one of the follow two:
1)C x y: set the value of ax to y;(0≤x≤n-1,0≤y≤1000)
2)Q x: calculate F(x) mod P, where P = 1000000007.
The number of the first operation is not more than 5000.
输出解释
For each Q operation, output the value of F(x) mod P.
输入样例
1
2 5
3 2
Q 3
C 0 2
Q 3
Q 0
C 0 3
输出样例
3
2
3
来自杭电HDUOJ的附加信息
Author FZU
Recommend

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

源链接: HDU-4867

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

共提交 0

通过率 --%
时间上限 内存上限
10000/5000MS(Java/Others) 130712/130712K(Java/Others)