Giving wrong answer in codechef

#include
#include
#include<unordered_map>
using namespace std;
int binarySearch(int arr[], int l, int r, int x)
{
if (r >= l) {
int mid = l + (r - l) / 2;

	// If the element is present at the middle
	// itself
	if (arr[mid] == x)
		return mid;

	// If element is smaller than mid, then
	// it can only be present in left subarray
	if (arr[mid] > x)
		return binarySearch(arr, l, mid - 1, x);

	// Else the element can only be present
	// in right subarray
	return binarySearch(arr, mid + 1, r, x);
}

// We reach here when element is not
// present in array
return -1;

}
int main() {
#ifndef ONLINE_JUDGE
freopen(“input.txt”, “r”, stdin);
freopen(“output.txt”, “w”, stdout);
#endif
int n;
cin >> n;
int a[n];
int b[n];
int num;
unordered_map<int, int> u;
unordered_map<int, int> m;
for (int i = 0; i < n; i++) {
cin >> num;
a[i] = num;
b[i] = num;
u[num] = i;
}
sort(b, b + n);
if (n < 130) {
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
for (int k = j + 1; k < n; k++) {
int ans = a[i] ^ a[j] ^ a[k];
int result = binarySearch(b, 0, n - 1, ans);
if (result != -1) {
if (u[ans] > k) {
cout << “Yes” << endl;
}
}
}
}
}
}
if (n > 130) {
for (int p = 0; p < 130; p += 2) {
int alpha = a[p] ^ a[p + 1];
m[alpha]++;
}

	for (auto x : m) {
		if (x.second > 1) {
			cout << "Yes" << endl;
		}
	}
}
return 0;

}

this is working fine for sample input but in codechef giving wrong answer when i tried to submit , I worked on the code for sometime but i couldn’t understand the problem , please solve this

hi @vineethanv4,
please save the code in ide.codingblocks.com and send the link big code is not readable at this platform