提交时间:2024-10-04 14:53:05
运行 ID: 33122
#include<bits/stdc++.h> using namespace std; #define int long long const int INF=1e9; int n,k; int a; int maxx,s; signed main(){ cin>>n>>k; maxx=-INF; s=0; for(int i=1;i<=n;i++){ cin>>a; maxx=max(maxx,(a^k)-a); s+=a; } cout<<s+maxx<<endl; //system("grep VmPeak/proc/$PPID/status"); return 0; }