← All problemsSign in

Special Operation

CodeChefRating 2430Open on judge ↗

You are given a matrix $A$ consisting of $N$ rows and $M$ columns. You task is to select an element $A_{(x, y)}$ $(1 \le x \le N, 1 \le y \le M)$ such that the following value is **maximised**: - $\sum_{i = 1, i\neq x}^{i = N} \sum_{j = 1, j\neq y}^{j = M} (A_{(i, j)} \oplus A_{(x, y)})$. Here, $\oplus$ denotes [bitwise XOR](https://en.wikipedia.org/wiki/Bitwise_operation#XOR) operation. In oth

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