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

建议使用的浏览器:

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

5598:GTW likes czf

题目描述
Long long age, there were two people named GTW and DSY, respectively. One day, in order to contend for CZF, the young girl of DSY, they decided to have a duel.

To start with, the two people were given a range, $l,l + 1,l + 2,...,r$, and two numbers, $G$ and $T$. Then, CZF chose either $G$ or $T$ as a number $X$ randomly, and chose an integer $Y$ in the range $[l, r]$ randomly, to perform a special operation, @, which is defined as that X @ Y =((X and Y) or Y) xor X. CZF wanted to know the number of numbers which could be the answer.

Nevertheless, GTW was not able to tackle this problem. In order to win CZF, he asked for your help.

Because the answer can be very large, you only need to print the answer modulo 1000000007.
输入解释
The first line of the input file contains exactly one integer, $T$, indicating the number of test cases. $(T\leq 10000)$

In the following $T$ lines, each line indicates a test case, containing 4 integers, $l, r, g, t$, whose meanings are given above. ($1\leq l,r,g,t\leq 10^{18},l\leq r$)
输出解释
There should be $T$ lines in the output file.

In each line of the output file, there should be exactly one number, indicating the answer of the test case respectively.
输入样例
1
2 4 2 4
输出样例
4
提示
2 xor 2=0,2 xor 3=1,2 xor 4=6
4 xor 2=6,4 xor 3=7,4 xor 4=0
There are 4 numbers :0,1,6,7
来自杭电HDUOJ的附加信息
Recommend hujie

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

源链接: HDU-5598

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

共提交 0

通过率 --%
时间上限 内存上限
4000/2000MS(Java/Others) 131072/131072K(Java/Others)