← All problemsSign in

Sum and XOR

CodeChefRating 2370Open on judge ↗

Let $f(A, B)$ denote the number of triples of integers $(X, Y, Z)$ satisfying the following conditions: - $0 \le X, Y, Z$ - $X + Y + Z = A$ - $X \oplus Y \oplus Z = B$ It can be shown that $f(A, B)$ is always finite. Here $\oplus$ represents the Bitwise XOR operator. You are given $2$ arrays $A$ and $B$ of length $N$ and $M$. Your task is to compute the value: $$ \displaystyle \prod_{i = 1}^{

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start