← All problemsSign in

Xor it

CodeChefRating 2236Open on judge ↗

Chef has given you a sequence A[1], A[2], ..., A[N] composed of N nonnegative integer numbers. Then, for each pair (i; j) such that 1 , we have written a number that equals to A[i] xor A[j] (xor is exclusive or, "xor" in Pascal, "^" in C++). Thus, we have obtained N*(N-1)/2 numbers. Your task is to find K minimal numbers among them. Input The first line of the input contains two space separated

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