题意:
解法:
令t=(x^y),t有两种情况:
1.如果t<=x,那么一次操作就行:直接将x^=t即可.
2.如果t>x,那么进行两次操作:先将x^=y,这时候x=t,然后将x^=旧的x,这时候x=y.
code:
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
ios::sync_with_stdio(0);cin.tie(0);
int x,y;cin>>x>>y;
int t=(x^y);
if(t<=x){
cout<<1<<endl;
cout<<t<<endl;
}else{
cout<<2<<endl;
cout<<y<<' '<<t<<endl;
}
return 0;
}