Comments
+12

For problem D, how do we arrive at the fact that the optimal solution has exactly (n+1)/2 elements?

IIT Kanpur Team name : DeepThought

Members — Radon12 aman9875 ankusht

Oh thanks for pointing it out.

Can someone please point out why this code does not work 37820945 while this code gets accepted 37840088 ,all i have changed is use vector instead of array. The non working code got stuck in some test cases and outputs only -1 for each query after a while.