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

建议使用的浏览器:

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

3800:Centeur

题目描述
The aliens in Centaurus a star reach the earth on Dec. 21th in 2012, and they are fairly smart. Before creating a friendly relationship with the human beings, they make a request that the intelligence of human must be tested. Upon their will, an earth citizen is asked to play the testing game with their boss, and rules of the game are as follows:
Given a row of bulbs whose total number is n, and the bulbs are numbered 1 to n from left to right, and each bulb has two states, named turned-on and turned-off. With the citizen from earth starts first, two players make their operations by turns. Every operation they make must meet the conditions:
Choose a bulb which is now on, then turn it off, and we assume this bulb is numbered p;
Choose a bulb and change its state(if on, then turn off, else, turn on), and suppose it is numbered q, which should meet the request of q <= p/2.

In addition, the step 2 is not a must.
And the one cannot move loses.
Eventually, the smart earth citizen wins this test soon.

However, another question is asked by an evil alien: Supposing there are turned-on bulbs in some sections at the beginning, and the other states can be decided by the citizen from earth. With this fixed rules, and the alien goes first, then how many original states will make the citizen from earth win the game?
输入解释
Line 1: a single integer t(1<=t<=30), which refers to the number of cases;
And for each case, the first line contains two integers n m(1<=n<=263-1,0<=m<=1000), and in the following m lines, each line has two integers:s t(1<=s<=t<=n), which means that the bulbs numbered from s to t (include s and t)are turned-on originally;
Attention, these sections may be overlapped.
输出解释
For each test case, output a single line with an integer indicates the total original number of states mod 100000007
输入样例
2
1 1
1 1
3 0
输出样例
0
2
提示
	When n = 3 , m = 0, there are two kinds of original states guaranteeing the winner of the earth
	citizen (From left to right, the bulbs are numbered 1 to n, and o refers to the turned-on bulbs, 
	And * refers to the turned-off):
***
ooo
来自杭电HDUOJ的附加信息
Author hust[等待]
Recommend notonlysuccess

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

源链接: HDU-3800

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

共提交 0

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