标签:des style blog http io os sp for on
#include<iostream> #include<map> #include<string> #include<cstring> #include<cstdio> #include<cstdlib> #include<cmath> #include<queue> #include<vector> #include<algorithm> using namespace std; int main() { vector<int>a; int i,j,k,n,t,ans; while(cin>>t) a.push_back(t); n=a.size(); ans=0; for(i=0;i<n;i+=2) { if(i==n-1) continue; ans^=a[i+1]-a[i]-1; } if(ans==0) cout<<-1; else { for(i=0;i<n;i++) { if(i==n-1) continue; for(j=1;j+a[i]<a[i+1];j++) { a[i]+=j; ans=0; for(k=0;k<n;k+=2) { if(k==n-1) continue; ans^=a[k+1]-a[k]-1; } a[i]-=j; if(ans==0) { cout<<a[i]<<" "<<a[i]+j; return 0; } } } } }
标签:des style blog http io os sp for on
原文地址:http://blog.csdn.net/stl112514/article/details/41849553