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

建议使用的浏览器:

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

4149:Magic Potion

题目描述
In a distant magic world, there is a powerful magician aswmtjdsj. One day,aswmtjdsj decide to teach his prentice ykwd to make some magic potions. The magic potion is made by 8 kinds of materials, what aswmtjdsj need to do is to tell ykwd how many each kind of materials is required. In order to prevent others from stealing these formulas, he decide to encrypt the formula. Assuming the amount of the eight kinds of materials are x1, x2, ... x8, aswmtjdsj will use a number m to encrypt, and finally tell ykwd nine numbers:x1 xor m, x2 xor m ,...., x8 xor m, (x1 + x2 +...+ x8) xor m . ykwd is too lazy,however,to calculate the value of the number m, so he asks you to help him to find the number m.

输入解释
The first line is an integer t, the number of test cases.
Each of the next t lines contains 9 integers, respectively, x1 xor m, x2 xor m ,...., x8 xor m, (x1 + x2 +...+ x8) xor m, each of the 9 numbers is less or equal to 231-1.
输出解释
For each test case you should output the value of m in a single line, you can assume that 0 <= m <= 231-1.
输入样例
2
1 2 3 4 5 6 7 8 36
5 5 5 5 5 5 5 5 123
输出样例
0
11

提示
The XOR operation takes two bit patterns of equal length and performs the logical XOR operation on each pair of corresponding bits. 
The result of each digit is 1 if the two bits are different, and 0 if they are the same. 
For example: 
    0101 (decimal 5)
XOR 0011 (decimal 3)
  = 0110 (decimal 6)
来自杭电HDUOJ的附加信息
Author BUPT
Recommend lcy

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

源链接: HDU-4149

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

共提交 0

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