Optimal game strategy-I


I just tried this program according to me my logic is correct, but my code is not compiling.
Is this due to TLE?

Hello disha,
code executes after compilation and verdict i.e wrong answer ,correct answer ,tle are results of execution. so comile error u r facing is not due to tle.

@dishask99 hey i think there is some issue in coding blocks ide. your code compiled successfully in my local ide

also there is logical error in your code . you are trying greedy approach(i.e everytime u are picking maximum) to solve this problem which will not work .