Matches Game

https://blog.csdn.net/cnlht/article/details/19233323

_____________________________题目见此:https://vjudge.net/contest/317081#problem/D

 

也可以看做奇偶性运算来理解呀哦!

借鉴代码:

#include<iostream>
#include<cstdio>
using namespace std;
int n;
int main()
{
	while(~scanf("%d",&n))
	{
		int ans=0,tmp;
		for(int i=1;i<=n;i++) 
		{
			scanf("%d",&tmp);
			ans^=tmp; //异或运算:0^0==1^1==0;0^1==1^0==1.
		}
		if(ans==0) printf("No\n");
		else printf("Yes\n");
	}
	return 0;
}

关于神妙的按位与运算!

 

posted @ 2019-08-04 16:34  龙龙666666  阅读(108)  评论(0编辑  收藏  举报