For this Question: Gruumm has set up N lasers with i<sup>th</sup> laser having attack power Attack[i], all pointing earth. The damage caused by lasers on earth is the XOR of the attack powers of all the lasers. Cruger wants to set up a shield of defensive strength K. As Cruger has budget constraints, K can only be a non-negative integer with value strictly less than the strength of the weakest laser (minimum value of Attack array) set by Gruumm. Due to the defense shield, the attack power of each laser reduces by K. Help Kruger find the number of values of K such that the damage caused by lasers on earth is 0.First line of input contains a single integer, N.
Second line of input contains N integers, denoting the array Attack.

Constraints:
1 <= N <= 10<sup>5</sup>
1 <= Attack[i] <= 10<sup>18</sup>Print a single integer denoting the number of values of K such that the damage on earth is 0.Sample Input 1
3
3 4 5

Sample Output 1
1

Explanation: Only valid value of K is 2. With K = 2, attack powers become [1, 2, 3] and (1 xor 2 xor 3) = 0


Sample Input 2
2
4 4

Sample Output 2
4

Explanation: valid values of K are [0, 1, 2, 3], I have written this Solution Code: #pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define VV vector
#define pb push_back
#define bitc  __builtin_popcountll
#define m_p make_pair
#define infi 1e18+1
#define eps 0.000000000001
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
string char_to_str(char c){string tem(1,c);return tem;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template<class T>//usage rand<long long>()
T rand() {
    return uniform_int_distribution<T>()(rng);
}
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

template<class T>
using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
// string to integer stoi()
// string to long long stoll()
// string.substr(position,length);
// integer to string to_string();
 
//////////////
auto clk=clock();
#define all(x) x.begin(),x.end()
#define S second
#define F first
#define sz(x) ((long long)x.size())
#define int long long  
#define f80 __float128
#define pii pair<int,int>
/////////////

const int MAXN = 100000;
const int MAXBIT = 62;
 
 
int n;
long long a[MAXN];
 
 
int cnt_with_bit[MAXBIT], ones_pref[MAXBIT][MAXN+1];
long long d[MAXBIT][MAXN+1];
 
long long get_d (int bit, int greater) {
  if (bit == MAXBIT)
    return greater ? 0 : 1;
 
  long long & my = d[bit][greater];
  if (my != -1)  return my;
  my = 0;
 
  for (int x_bit=0; x_bit<2; ++x_bit) {
    int ngreater = 0,  cur_xor = 0;
    for (int tp=0; tp<2; ++tp)
      for (int a_bit=0; a_bit<2; ++a_bit) {
        int cnt = ones_pref[bit][greater],
          total = tp==0 ? greater : n-greater;
        if (tp)
          cnt = cnt_with_bit[bit] - cnt;
        if (!a_bit)
          cnt = total - cnt;
 
        if (x_bit > a_bit || x_bit == a_bit && tp == 0)
          ngreater += cnt;
 
        int res_bit = (a_bit - x_bit - (1-tp)) & 1;
        if (res_bit)
          cur_xor ^= cnt & 1;
      }
      
    if (!cur_xor)
      my += get_d (bit+1, ngreater);
  }
 
  return my;
}
 
void calc_tables() {
  for (int bit=0; bit<MAXBIT; ++bit) {
    cnt_with_bit[bit] = 0;
    for (int i=0; i<n; ++i)
      if (a[i] & (1ll << bit))
        ++cnt_with_bit[bit];
  }
 
  vector<int> order (n);
  for (int i=0; i<n; ++i)
    order[i] = i;
  for (int bit=0; bit<MAXBIT; ++bit) {
    vector<int> v[2];
    for (int i=0; i<n; ++i) {
      ones_pref[bit][i] = (int) v[1].size();
      v[(a[order[i]] >> bit) & 1].push_back (order[i]);
    }
    ones_pref[bit][n] = (int) v[1].size();
    order = v[0];
    order.insert (order.end(), v[1].begin(), v[1].end());
  }
}
 
 
signed main() {
    
	fastio;
	#ifdef ANIKET_GOYAL
		freopen("inputf.in","r",stdin);
		freopen("outputf.in","w",stdout);
	#endif
	cin >> n;
	for (int i=0; i<n; ++i){
		cin >> a[i];
	}
	
	calc_tables();
	memset (d, -1, sizeof d);
	long long ans = get_d (0, 0);
	long long mi = * min_element (a, a+n);
	long long x = 0;
	for (int i=0; i<n; ++i)
		x ^= a[i] - mi;
	if (!x)
		--ans;
 
	cout << ans << endl;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?