Exclusive mean
CodeChefOpen on judge ↗
Tourist has given you an array of size $n$. He allowed you to modify the array in the following way, in one operation you can swap any two elements of the array. Formally, a swap means you can choose two indices $i,j$ $1 \leq i,j \leq n$ (indexing starts from $1$) and exchange the values of $a_i$ and $a_j$ He is greedy and likes smaller numbers, so he wants you to minimize the Exclusive Mean
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.
Sign in to chat with the tutor and save your progress.
Sign in to start