Why this Code giving WA here, It's Submitted on Codechef

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using ull = unsigned long long;
using vi = vector;
using vll = vector;

void solve()
{
ull n;
cin >> n;
vector a(n);
map<ull, ull> mp;
for (ull i = 0; i < n; i++) {
cin >> a[i];
mp[a[i]]++;
}

if (n >= 130) {
	cout << "Yes\n";
	return;
}

for (ull i = 0; i < n; i++) {

	for (ull j = i + 1; j < n; j++) {

		for (ull k = j + 1; k < n; k++) {

			ull num = a[i] ^ a[j] ^ a[k];
			ull cnt = mp[num];
			if (num == a[i]) {
				cnt--;
			}

			if (num == a[j]) {
				cnt--;
			}

			if (num == a[k]) {
				cnt--;
			}

			if (cnt > 0) {
				cout << "Yes\n";
				return;
			}

		}
	}
}

cout << "No\n";

}

int main()
{

ios_base::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);

solve();

return 0;

}

Hello, @devang_11912089,

You need to print β€œYES” and β€œNO” here, but on CodeChef you need to print β€œYes” and β€œNo”.

Oh, Got it, my mistake

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.