hzau 1206 MathematicalGame

1206: MathematicalGame

Time Limit: 2 Sec  Memory Limit: 1280 MB
Submit: 124  Solved: 15
[Submit][Status][Web Board]

Description

     Xiao Ming likes to play mathematical games very much. One day, he gets a sequence of n positive integers. XOR (l , r) is defined as the XOR and of all numbers in a continuous interval. Now, Xiao Ming wants to know the intervals which make the XOR (l , r) become largest.

    Require l, r. 

Input

     There is an integer T at the first line, indicate the case of data.

     In each case, there is an integer N at the first line, indicate the length of the sequence. And there are N integers, a1, a2, … , an, at the second line. (N <= 1,000,000) 

 

Output

    In each case, the first line is “Case #k:”, k is the number of test cases, the next line includes two integers l and r, which separated by a space.

    l, r output in lexicographic order if there are multiple results.  

Sample Input

1
5
1 2 3 4 5

Sample Output

Case #1:
3 4

HINT

 

转载于:https://www.cnblogs.com/bofengyu/p/6790507.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值