On Sunday, April 16, 2017 at 3:04:03 PM UTC, Wing-chung Leung wrote:
> So I'll put my questions here:
> (1) is there a better algorithm to do this?

Turns out the answer is "yes". The reason: in the simulations, if the dragon 
have full hp, it get hit the same number of times before needing to cure. (The 
determination of the number of debuffs depends on "the number of debuff/attack 
cast before cure is needed".)

So the large middle part of the debuffs, i.e. those between the first and the 
last cures, can be simulated in constant time. The same holds for the last 
part, because a cure is not needed in that part. The first part of the debuff 
still needs to be simulated, but it appears to be in O(sqrt(n)).

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/93812463-9f35-4566-8d77-8eacd20bad9e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to