[Help Needed]

Revision en1, by Varun12, 2022-07-04 08:53:43

You are in your kingdom with no troops but your barracks train X troops daily. Initially X = 1. There are N neighbor kingdom each of which has A[i] amount of troops guarding it. To take over a kingdom you need to attack it with at least A[i] troops. Once you capture a kingdom, as a consequence of war, all of your troops die (even if you attacked with > A[i] troops), and X increases by 1. Assuming Attacking and capturing a kingdom takes no time, find the minimum days the worthy king needs to wait to take over the entire globe.

1 <= N <= 20 1 <= A[i] <= 1e6

Tags greedy, recursion, dp, dynamic programming


  Rev. Lang. By When Δ Comment
en2 English Varun12 2022-07-04 08:57:03 113
en1 English Varun12 2022-07-04 08:53:43 596 Initial revision (published)