Wednesday, August 20, 2014

COJ 1024. Hangover

Here is the problem statement
http://www.spoj.com/problems/HANGOVER/

 Just because the constraints are 5.2>N>0.02 this task can be solved with a simple implementation. Just loop from 2 and add to our current legth the 1/i (i is our current loop value)/ If we reached the value print the index and exit.


       DOWNLOAD THE FULL SOURCE CODE

No comments:

Post a Comment