HDU 2095 find your present (2) 异或的经典运用
2013-12-16 13:00
423 查看
原题链接
异或的经典应用
异或运算法则
1. a ^ b = b ^ a
2. a ^ b ^ c = a ^ (b ^ c) = (a ^ b) ^ c;
3. d = a ^ b ^ c 则 a = d ^ b ^ c.
4. a ^ b ^ a = b
附ac代码:
异或的经典应用
异或运算法则
1. a ^ b = b ^ a
2. a ^ b ^ c = a ^ (b ^ c) = (a ^ b) ^ c;
3. d = a ^ b ^ c 则 a = d ^ b ^ c.
4. a ^ b ^ a = b
附ac代码:
#include <stdio.h> int main(){ int t, a, b; while(scanf("%d", &t), t){ a = 0; while(t-- && scanf("%d", &b)) a ^= b; printf("%d\n", a); } return 0; }
相关文章推荐
- HDU 2095 find your present (2) 异或的经典运用
- hdu - 2095 - find your present (2)(异或)
- HDU 2095 find your present (2) (异或)
- HDU 2095 find your present (2) 【异或】
- HDU-2095 find your present (2) 按位异或求解
- HDU 2095 find your present (2) 异或
- hdu 2095 find your present (2)(位异或)
- HDU 2095 Find your present (2) (位异或)
- HDU 2095 find your present(异或)
- HDU 2095 find your present (2)(位运算 或 排序做)
- hdu 2095 find your present (2)(^的有趣应用)
- 容器+位异或 HDU 2095 find your parents(2)
- HDU 2095 find your present (2)
- hdu 2095 find your present (2)
- HDU 2095 find your present (2)
- HDU 2095 find your present (2) (水)
- HDU 2095 find your present (2)
- hdu 2095 find your present (2)
- 杭电 2095 find your present (2)【位运算 异或】
- HDU 2095 find your present (2)(简单题目)