https://www.codechef.com/BITM2021/problems/HBOB02

Why my solution is giving wrong answer despite of correct logic can anyone check i cannot figure out.

#include <unordered_set>
#include <unordered_map>
#include <bits/stdc++.h>

#define ll long long

typedef ll int lli;

using namespace std;

void solve()
{
int t=1;
//cin>>t;
while(t–)
{
lli n, k;
cin>>n>>k;
lli a[n];
for(lli i=0;i<n;i++)
cin>>a[i];
lli b[n];
b[0]=a[0];
for(lli i=1;i<n;i++)
b[i] = (a[i]^a[i-1]);
lli count = 0;
for(lli i=0;i<n;i++)
{
if(((1<<(k-1))&b[i]))
count++;
}
cout<<count<<endl;
}
}

int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
#ifndef ONLINE_JUDGE
freopen(“input.txt”,“r”,stdin);
freopen(“output.txt”,“w”,stdout);
#endif
solve();
return 0;
}