Zonal Computing Olympiad is round 1 out of 3 (i.e. beginner) for selection into Indian IOI team.
N knights are sitting in a circle. Making a dessert ...
dp[i]=min. cost till 'i' if a was not taken,
dp[i]=min. cost till 'i' if a was taken.
Problem in short:
Hussain has a multiset of integers. In every move Hussain removes a maximum number from this multiset and divides it by 2...
Why would a O(N) = N*log N solution give TLE when N=10^6....???
O(N=10^6) = (6*10^6) < (2*10^8)