hdu(1563)Find your present!
来源:互联网 发布:四舍五入数据 英文 编辑:程序博客网 时间:2024/05/29 13:16
整数的异或是先把它们化成二进制,再按位异或。
比如3^5, 3=011,5=101,两数按位异或后为110,即6。
几个数异或满足交换律。2^3^2=2^2^3=0^3=3.
两个相同的数异或为0,普通数都出现了偶数次,所以它
们异或后都是0,而0与那个特别数异或后还是那个特殊数。
#include"stdio.h"
int main()
{
int m,n,s;
while(scanf("%d",&n),n)
{
s=0;
while(n--)
{
scanf("%d",&m);
s=s^m;
}
printf("%d\n",s);
}
return 0;
}
- hdu(1563)Find your present!
- hdu 1563 Find your present!
- hdu-1563 Find your present!
- hdu 1563 Find your present!
- HDU 1563 Find your present!
- hdu-2095-find your present (2)//1563-find your present
- hdu-oj 1563 Find your present!
- HDU 1563 Find your present!【暴力】
- hdu 2095 find your present(2)
- HDU 2095 find your present
- hdu 1563简单异或Find your present!
- 杭电 HDU ACM 1563 Find your present!
- HDOJ(HDU) 1563 Find your present!(异或)
- 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) (set STL)
- 唯一性索引优化实践(讲得好细哦)
- IOS---VM ware9.0安装 10.8 Mountain Lion +Xcode4.6.5(一)
- Codeforces Beta Round #36 / 36A Extra-terrestrial Intelligence(模拟)
- 图片按钮 CSS
- QQ2013手工去广告
- hdu(1563)Find your present!
- android开发之应用编程
- Android Tombstone/Crash的log分析和定位
- hdu 4678 Mine(博弈SG,4级)
- MPMoviePlayerController 视频播放器—IOS开发
- 如何签名发布软件
- 【周全考虑】CodeForces 245B——Internet Address
- 打泡泡游戏
- SDK Simples 之 Accelerometer Play