方法搞不懂啊
幾下來當模板:
#include<iostream>
using namespace std;
int main()
{
int i,n,m;
while(cin >> n)
{
int flag = 0; //判斷是否是孤單堆
int s = 0;
for(i = 0;i < n;i++)
{
cin >> m;
s ^= m;
if(m > 1)
flag = 1;
}
if(flag == 0)
if(n % 2)
cout << "No\n";
else
cout << "Yes\n";
else
if(s == 0)
cout << "No" <<endl;
else
cout << "Yes" <<endl;
}
return 0;
}