Marks :10
: 5 | : 0
You are given an integer array $$$A$$$ of size $$$N$$$. Your task is to count number of XOR AND inversion iff if it satisfies the following conditon.
$$$1\le i < j \le N$$$
$$$A[i] $$$&$$$ A[j] ≥ $$$ $$$A[i] $$$^$$$ A[j]$$$
First line contains an integer $$$1\le N\le 10^{5}$$$.
Second line contains $$$N$$$ space separated integers denoting array elements $$$1\le A[i] \le 10^{5}$$$ where $$$(1\le i \le N)$$$
Print count of XOR AND inversions as described above.
5 7 12 16 10 6
2
6 2 4 32 8 16 64
0
Here $$$&$$$ denotes bitwise AND and $$$^$$$ denotes bitwise XOR.
In first test case there are only 2 pairs that satisfy both the conditions those are.
$$$1>$$$ $$$(1,5)$$$ its respective element are $$$(7,6)$$$, $$$(7$$$&$$$6)=6$$$ and $$$(7$$$^$$$6)=1$$$ Here $$$(7&6)≥(7^6)$$$
$$$2>$$$ $$$(2,4)$$$ its respective element are $$$(12,10)$$$, $$$(12$$$&$$$10)=8$$$ and $$$(12$$$^$$$10)=6$$$ Here $$$(12&10)≥(12^10)$$$
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.