Array Game
CodeChefOpen on judge ↗
Alice has an array $A$ and Bob an array $B$ of sizes $N$ and $M$ respectively. Alice wants every value of her array to be greater than or equal to the values of Bob's array. In other words for every pair $(i ,j)$ $A[ i ] \geq B[ j ]$. In one operation she can increase or decrease any element of array $A$ or array $B$ by 1. Since she is always in a hurry he wants to perform this in minimum op
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