For this Question: Sara has an array Arr of N elements and an element K. Sara loves XOR so she took the xor value of all the possible subarrays(N*(N+1)/2)) from the given array and stored them in non- increasing order. Sara wants to know the kth maximum element of all the subarray's XOR. Since you want to impress Sara give the Kth maximum element before Sara finds it.The first line of input contains N and K.
The second line of input contains N space separated integers.

Constraints:-
1 <= N <= 100000
1 <= K <= (N*(N+1))/2
0 <= Arr[i] <= 2^20Print the Kth maximum element.Sample Input:-
5 5
1 4 3 12 8

Sample Output:-
8

Explanation:-
All xor's:- 15, 12 11 10, 8, 7, 7, 6, 5, 4, 4, 3, 3, 2, 1

Sample Input:-
3 2
1 2 3

Sample Output:-
3

Explanation:-
XOR:- 3 3 2 1 1 0, I have written this Solution Code: # include <bits/stdc++.h>
using namespace std;
# define fi cin
# define fo cout
# define x first
# define y second
# define ll long long
# define IOS ios_base :: sync_with_stdio(0);cin.tie(0)
# define vi vector < int >
# define pii pair < int , int >
# define mp make_pair
# define vii vector < pii >
# define pb push_back
# define all(s) s.begin(),s.end()
template < class T > T smin(T &a,T b) {if (a > b) a = b;return a;}
template < class T > T smax(T &a,T b) {if (a < b) a = b;return a;}
int main(void)
{
    IOS;
    int n;
    ll k;
    fi>>n>>k;
    const int Const = 19;
    static int s[1 << 20];
    for (int i = 1;i <= n;++i)
        fi>>s[i],s[i] ^= s[i - 1];
    static vector < array < int , 2 > > index;
    static vi cnt;
    index.pb({-1,-1});
    cnt.pb(0);
    auto next = [&](int pos,int bit)
    {
        if (index[pos][bit] == -1)
            cnt.pb(0),index.pb({-1,-1}),index[pos][bit] = index.size() - 1;
        pos = index[pos][bit];
        return pos;
    };
    auto get = [&](int pos,int bit)
    {
        if (index[pos][bit] == -1)
            return 0;
        else
            return cnt[index[pos][bit]];
    };
    for (int i = 0;i <= n;++i)
    {
        int pos = 0;
        for (int t = Const;t + 1;--t)
            ++cnt[pos],pos = next(pos,(s[i] >> t) & 1);
        ++cnt[pos];
    }
    auto f = [&](int C)
    {
        ll ans = 0;
        for (int i = 0;i <= n;++i)
        {
            int pos = 0;
            for (int t = Const;pos != -1 && t + 1;--t)
            {
                int bit = ((C >> t) & 1) ^ ((s[i] >> t) & 1);
                if (!((C >> t) & 1))
                    ans += get(pos,!bit);
                pos = index[pos][bit];
            }
            ans += cnt[pos];
        }
        return ans;
    };
    int ans = 1 << 20;
    for (int t = 1 << 19;t;t /= 2)
        if (f(ans - t) < k + k)
            ans -= t;
    --ans;
    fo << ans << '\n';
    return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?