Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
33110 | hi_hi | 【J】T1 | C++ | 通过 | 100 | 11 MS | 1056 KB | 464 | 2024-10-04 14:22:53 |
#include<bits/stdc++.h> using namespace std; const int N=100100; int n; long long a[N],k; long long ans=0; long long sum=0; int main(){ //freopen("xor.in","r",stdin); //freopen("xor.out","w",stdout); ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin>>n>>k; for(int i=1;i<=n;i++){ cin>>a[i]; ans+=a[i]; } for(int i=1;i<=n;i++){ sum=max(sum,ans-a[i]+(a[i]^k)); } cout<<sum<<endl; }