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

hzau 1206 MathematicalGame的更多相关文章

  1. codevs 1206 保留两位小数

    http://codevs.cn/problem/1206/ 1206 保留两位小数  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 青铜 Bronze 题解  查看运行结果 ...

  2. wikioi 1206 保留两位小数 【考查浮点数输入输出】

    /*======================================================================== 1206 保留两位小数 题目描述 Descript ...

  3. (hzau)华中农业大学第四届程序设计大赛网络同步赛 G: Array C

    题目链接:http://acm.hzau.edu.cn/problem.php?id=18 题意是给你两个长度为n的数组,a数组相当于1到n的物品的数量,b数组相当于物品价值,而真正的价值表示是b[i ...

  4. mysql报错"ERROR 1206 (HY000): The total number of locks exceeds the lock table size"的解决方法

    1. 问题背景         InnoDB是新版MySQL(v5.5及以后)默认的存储引擎,之前版本的默认引擎为MyISAM,因此,低于5.5版本的mysql配置文件.my.cnf中,关于InnoD ...

  5. 【mysql】1206 SQLSTATE: HY000 (ER_LOCK_TABLE_FULL) 问题

    最近在做一个项目,其中一需求是:部分数据库中的数据需要定时删除掉(满足一定条件,比如7天前的数据都不保留) 最初的执行方法: 使用Quartz定时执行数据库操作,进行数据删除,数据库操作使用delet ...

  6. 51nod 1206 && hdu 1828 Picture (扫描线+离散化+线段树 矩阵周长并)

    1206 Picture  题目来源: IOI 1998 基准时间限制:2 秒 空间限制:131072 KB 分值: 160 难度:6级算法题  收藏  关注 给出平面上的N个矩形(矩形的边平行于X轴 ...

  7. 51nod 1206 Picture 矩形周长求并 | 线段树 扫描线

    51nod 1206 Picture 矩形周长求并 | 线段树 扫描线 #include <cstdio> #include <cmath> #include <cstr ...

  8. MySQL解决[Err] 1206 - The total number of locks exceeds the lock table size问题

    MySQL解决[Err] 1206 - The total number of locks exceeds the lock table size问题 查看MySQL版本:mysql>show ...

  9. HZAU 1207 Candies(线段树区间查询 区间修改)

    [题目链接]http://acm.hzau.edu.cn/problem.php?id=1207 [题意]给你一个字符串,然后两种操作:1,将区间L,R更新为A或者B,2,询问区间L,R最长的连续的B ...

随机推荐

  1. 洛谷 P3393 逃离僵尸岛

    洛谷 这道题目其实是最短路裸题. 首先看到题目,要求的到"被占点"距离不大于S的点,自然想到了以"被占点"为源点,求一遍最短路,处理出"危险点&quo ...

  2. Python 新手常犯错误

    Python 新手常犯错误(第二部分) 转发自:http://blog.jobbole.com/43826/ 作用域 在这篇文章里,我们来关注作用域在Python被误用的地方.通常,当我们定义了一个全 ...

  3. MySQL的SQL MODE

    SQL MODE:定义mysqld对约束等的响应行为:    查看当前模式:        mysql> SHOW GLOBAL VARIABLES LIKE 'sql_mode';    修改 ...

  4. 解决问题知识点--mysql数据库

    一: 连接 多表的字段中含null的  多表查询 ----左右连接查询! 例: 一张  emp(emano,ename,sal,deptno) 雇员表, 一张 dept(deptno,dname) 部 ...

  5. Polar 投影c#版本移植

    from:http://hi.baidu.com/sungaoyong/item/0c4584d25873f131e3108f05 ///刘泽军java版本的极坐标投影c#版本的移植 using Sy ...

  6. C#将图片白色背景设置为透明

    Image image = System.Drawing.Image.FromFile(@"C:\A.JPG"); Bitmap pbitmap = new Bitmap(imag ...

  7. LeetCode:数据库技术【175-178】

    LeetCode:数据库技术[175-178] LeetCode已经刷完200道题目,但这只是开始,下一段时间,仍然把刷题作为重点,争取再次完成200道,本篇博客将会带大家熟悉一些数据库面试题,从简单 ...

  8. nfs共享存储

    1.下载软件包 yum install nfs-utils nfs-utils-lib -y 2.编辑/etc/exports文件: 1.创建目录:mkdir -p /home/glance2.编辑e ...

  9. Python 开发者节省时间的 10 个小技巧

    Python 是一个美丽的语言,可以激发用户对它的爱.所以如果你试图加入程序员行列,或者你有点厌倦C++,Perl,Java 和其他语言,我推荐你尝试Python. Python有很多吸引程序员的功能 ...

  10. ThinkPHP框架基础知识一

    ThinkPHP是一个快速.兼容而且简单的轻量级国产PHP开发框架,诞生于2006年初,原名FCS,2007年元旦正式更名为ThinkPHP,遵循Apache2开源协议发布,从Struts结构移植过来 ...