标签:
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1937 Accepted Submission(s): 1115
#include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<stdlib.h> #include<queue> #include<stack> #include<algorithm> #include<ctype.h> #define LL __int64 using namespace std; const int MAXN=200000+50; const int INF=0x3f3f3f3f; const double EPS=1e-9; int dir4[][2]={{0,1},{1,0},{0,-1},{-1,0}}; int dir8[][2]={{0,1},{1,1},{1,0},{1,-1},{0,-1},{-1,-1},{-1,0},{-1,1}}; int dir_8[][2]={{-2,1},{-1,2},{1,2},{2,1},{2,-1},{1,-2},{-1,-2},{-2,-1}}; int a[MAXN]; int main() { int n; while(scanf("%d",&n) && n) { int sum=0; for(int i=0;i<n;i++) { scanf("%d",&a[i]); sum^=a[i]; } if(sum==0) printf("No\n"); else { printf("Yes\n"); for(int i=0;i<n;i++) { int s=sum^a[i]; if(s<a[i]) printf("%d %d\n",a[i],s); } } } return 0; }
标签:
原文地址:http://www.cnblogs.com/clliff/p/4256808.html