Avatar
“”

一个兴趣使然的追梦人

▼

AIGC标识 Codeforces Round 1090 (Div. 4)_E. The 67th XOR Problem

E. The 67th XOR Problem,传送门<-点我

题面如下

image

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

注意到

image

拓展

image
\(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 ;
}
posted @ 2026-09-22 20:59  hermanO  阅读(9)  评论(0)    收藏  举报