Codeforces Round 1090 (Div. 4)_E. The 67th XOR Problem
E. The 67th XOR Problem,传送门<-点我
题面如下

首先我们一定要记住这个异或性质

注意到

拓展

\(ACcode\)
void solve() {
int n ;
cin >> n ;
vector<int>a(n) ;
for(int i = 0;i < n;i++){
cin >> a[i] ;
}
int ans = 0 ;
for(int i = 0;i < n - 1;i++){
for(int j = i ;j < n;j++){
int tep = a[i] ^ a[j] ;
ans = max(ans,tep) ;
}
}
cout << ans << endl ;
}

浙公网安备 33010602011771号