编程介的小学生 2019-09-16 22:02 采纳率: 20.5%
浏览 107

Where is Bob 怎么实现的代码

Problem Description
Alice is playing a game with JSL. (...where is Bob?)

Alice picks a number x from segment [l1,r1]. After saw this number, JSL picks a number y from segment [l2,r2].(x and y may have same value). Finally, they compute z=x⊕y (⊕ is exclusive or). Alice wants z to be as maximal as possible while JSL wants z to be as minimal as possible. Alice and JSL are both clever enough, and what's the final value of z?

Input
Multiple test cases. In the first line there is an integer T, indicating the number of test cases.
For each test cases, there are four integers l1,r1,l2,r2 .
1≤T≤10000,0≤l1≤r1≤109,0≤l2≤r2≤109

Output
For each test case, output one line. The output format is Case #x: ans, x is the case number,starting from 1. ans is the value of z.

Sample Input
2
1 4 3 8
1 3 4 7

Sample Output
Case #1: 2
Case #2: 4

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥40 复杂的限制性的商函数处理
    • ¥15 程序不包含适用于入口点的静态Main方法
    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码