A. The Third Three Number Problem

A. The Third Three Number Problem_第1张图片

 题目大意 : 就是考了按位异或 问你 a^b+b^c+a^c=n 能不能找到a b c 按位异或就是都转化成二进制 相同变零不同变1

解题思路 :一定是偶数 所以假设a=0 b=0 c=n/2  奇数输出-1

 ac 代码:A. The Third Three Number Problem_第2张图片

你可能感兴趣的:(算法)