标签:
2 45 45 3 3 6 9 5 5 7 8 9 10 0
No Yes 9 5 Yes 8 1 9 0 10 3
题意:中文题.....不说了....
分析:这不和hdu1850差不多嘛;稍微改一下不就行了
#include <iostream> #include <cstdio> #include <cstring> #include <stack> #include <queue> #include <map> #include <set> #include <vector> #include <cmath> #include <algorithm> using namespace std; const double eps = 1e-6; const double pi = acos(-1.0); const int INF = 1e9; const int MOD = 1e9+7; #define ll long long #define CL(a,b) memset(a,b,sizeof(a)) #define lson (i<<1) #define rson ((i<<1)|1) #define N 50010 int gcd(int a,int b) { return b?gcd(b,a%b):a; } int n,a[200000+10]; int main() { while(scanf("%d",&n),n) { int sum=0,ans=0; for(int i=0; i<n; i++) { scanf("%d",&a[i]); sum ^= a[i]; } if(sum==0) cout<<"No"<<endl; else { cout<<"Yes"<<endl; for(int i=0; i<n; i++) { if((sum^a[i]) <= a[i]) cout<<a[i]<<" "<<(sum^a[i])<<endl; } } } return 0; }
标签:
原文地址:http://blog.csdn.net/d_x_d/article/details/52124585