Re:
Posted: Wed Mar 16, 2011 1:15 am
Wow, it is really a great approach to transform the use of double into int. It is really embarrassing that I use epsilon for double to solve this probelmlittle joey wrote:Sorry, I wasn't very clear.
You can use 1/(rate1*rate2) as unit of time, in stead of whole seconds, and then all times are expressible in an integer amount of these time units.
So if person1 eats amount a at rate1, it would take a/rate1 seconds, which is a*rate2 new time units; and a call at second t, is at t*rate1*rate2 new time units. Etc. Because we only have to compare times in this problem, we can always use exact integer comparisons if we use these new time units.
