I am getting wrong answer on my solution please help me to find the error

#include<bits/stdc++.h>
using namespace std;
#define endl “\n”
#define sd(val) scanf("%d",&val)
#define ss(val) scanf("%s",&val)
#define sl(val) scanf("%lld",&val)
#define all(v) v.begin(),v.end()
#define PB push_back
#define MP make_pair
#define FF first
#define SS second
#define ll long long int
#define MOD 1000000007
#define clr(val) memset(val,0,sizeof(val))
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

int main()
{
/#ifndef ONLINE_JUDGE
freopen(“input.txt”, “r”, stdin);
freopen(“output.txt”, “w”, stdout);
#endif
/
int n;
cin>>n;
if(n>=130)
cout<<“Yes”;
else
{
int arr[n];int d=0;
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
int flag=0;
sort(arr,arr+n);
for(int i=0;i<n-2;i++)
{
for(int j=1;j<n-1;j++)
{
for(int k=2;k<n;k++)
{
d=arr[i]^arr[j]^arr[k];
bool x=binary_search(arr+k,arr+n,d);
if(x==true)
{
flag=1;
break;
}
}
}
}
if(flag==1)
cout<<“Yes”;
else
{
cout<<“No”;
}
}

return 0;

}

#include<bits/stdc++.h> using namespace std; #define endl “\n” #define sd(val) scanf("%d",&val) #define ss(val) scanf("%s",&val) #define sl(val) scanf("%lld",&val) #define all(v) v.begin(),v.end() #define PB push_back #define MP make_pair #define FF first #define SS second #define ll long long int #define MOD 1000000007 #define clr(val) memset(val,0,sizeof(val)) #define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); int main() { /#ifndef ONLINE_JUDGE freopen(“input.txt”, “r”, stdin); freopen(“output.txt”, “w”, stdout); #endif/ int n; cin>>n; if(n>=130) { cout<<“Yes”; return 0; } int arr[n];int d=0; for(int i=0;i<n;i++) { cin>>arr[i]; } for(int i=0;i<n;i++) for(int j=i+1;j<n;j++) for(int k=i+2;k<n;k++) for(int d=k+1;d<n;d++) if((arr[i]^arr[j]^arr[k]^arr[d])==0) { cout<<“Yes”; return 0; } cout<<“No”; return 0; }

i have changed code but then also i am getting wrong ans

k should start from j+1.

then also wrong answer

Numbers are large take long long datatype instead of int

then also i am getting wrong answer

Give ur updated code.

#include<bits/stdc++.h> using namespace std; #define endl “\n” #define sd(val) scanf("%d",&val) #define ss(val) scanf("%s",&val) #define sl(val) scanf("%lld",&val) #define all(v) v.begin(),v.end() #define PB push_back #define MP make_pair #define FF first #define SS second #define ll long long int #define MOD 1000000007 #define clr(val) memset(val,0,sizeof(val)) #define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); int main() { /#ifndef ONLINE_JUDGE freopen(“input.txt”, “r”, stdin); freopen(“output.txt”, “w”, stdout); #endif/ ll n; cin>>n; if(n>=130) cout<<“Yes”; else { ll arr[n]; ll d=0; for(ll i=0;i<n;i++) { cin>>arr[i]; } ll flag=0; sort(arr,arr+n); for(ll i=0;i<n-2;i++) { for(ll j=1;j<n-1;j++) { for(ll k=2;k<n;k++) { d=arr[i]^arr[j]^arr[k]; bool x=binary_search(arr+k,arr+n,d); if(x==true) { flag=1; break; } } } } if(flag==1) cout<<“Yes”; else { cout<<“No”; } } return 0; }

Just take 4 for loops to check the condition.