For this Question: Newton is forced to solve a puzzle given by his friend Ramanujan. In the puzzle Newton is given N non-negative integers T<sub>1</sub>, T<sub>2</sub>, ... T<sub>N</sub>, and another positive integer X. Now, Newton has to choose an integer Z between 0 and X, such that the function f(Z) = (Z xor T<sub>1</sub>) + (Z xor T<sub>2</sub>) + ... + (Z xor T<sub>N</sub>) returns maximum value. Help Newton calculate the maximum value that is possible under the given constraints.The first line contains 2 integers, N and X.
The second line contains N integers T<sub>1</sub>, T<sub>2</sub>, ... T<sub>N</sub>

<b>Constraints:</b>
1 <= N <= 2 x 10<sup>5</sup>
0 <= X <= 10<sup>12</sup>
0 <= T<sub>i</sub> <= 10<sup>12</sup>Find and print the maximum value.<b>Sample Input 1:</b>
4 10
1 2 3 4

<b>Sample Output 1:</b>
42

<b>Explanation:</b>
Maximum value can be achieved by choosing Z as 9.
(9 xor 1) + (9 xor 2) + (9 xor 3) + (9 xor 4) = 42


<b>Sample Input 2:</b>
4 10
11 9 6 98

<b>Sample Output 2:</b>
132, I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
#define all(p) p.begin(),p.end()
#define rep(i,a) for(int i=0;i<a;i++)
using ll=long long;
template<class T> bool chmax(T &a,T const b){if(a<b){a=b;return true;}return false;}

int main() {
	ll N,K;
	cin>>N>>K;
	K++;
	int D=42;
	vector<ll> p(D);
	rep(i,N){
		ll a;
		cin>>a;
		rep(j,D){
			if((a&(1ll<<j))==0) p[j]++;
		}
	}
	ll ans=-(1ll<<60),tmp=0;
	for(int i=D-1;i>=0;i--){
		if(K&(1ll<<i)){
			ans+=(1ll<<i)*max(p[i],N-p[i]);
			chmax(ans,tmp+(1ll<<i)*(N-p[i]));
			tmp+=(1ll<<i)*p[i];
		}else{
			tmp+=(1ll<<i)*(N-p[i]);
			ans+=(1ll<<i)*max(p[i],N-p[i]);
		}
	}
	cout<<ans<<"\n";
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?