首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

Be the Winner(SJ定律)

2013-10-06 
Be the Winner(SJ定理)http://acm.hdu.edu.cn/showproblem.php?pid2509// File Name: hdu2509.cpp// Auth

Be the Winner(SJ定理)

http://acm.hdu.edu.cn/showproblem.php?pid=2509

// File Name: hdu2509.cpp// Author: bo_jwolf// Created Time: 2013年10月04日 星期五 13:45:37#include<vector>#include<list>#include<map>#include<set>#include<deque>#include<stack>#include<bitset>#include<algorithm>#include<functional>#include<numeric>#include<utility>#include<sstream>#include<iostream>#include<iomanip>#include<cstdio>#include<cmath>#include<cstdlib>#include<cstring>#include<ctime>using namespace std;int main(){int n, ans, temp, sum;while( scanf( "%d", &n ) != EOF && n ){ans = sum = 0;while( n-- ){scanf( "%d", &temp );if( temp > 1 )sum++;ans ^= temp;}if( ans == 0 ){if( sum )printf( "No\n" );elseprintf( "Yes\n" );}else{if( sum )printf( "Yes\n" );elseprintf( "No\n" );}}return 0;}


热点排行