标签:
题目描述:
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int maxn = 1e6+10; int a[maxn]; int main() { int n; while(~scanf("%d",&n)){ int ans= 0,num1=0,num2=0; for(int i=0;i<n;i++){ scanf("%d",&a[i]); ans^=a[i]; } int x = ans&(-ans); for(int i=0;i<n;i++){ if(x&a[i]) num1^=a[i]; else num2^=a[i]; } printf("%d %d\n",min(num1,num2),max(num1,num2)); } return 0; }
标签:
原文地址:http://blog.csdn.net/bigbigship/article/details/45485079