ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1688. Team.GOV!

hint about WA#11
Posted by melkiy 1 Mar 2009 09:58
People, __int64 not needed! I quickened my program from 0.31 to 0.15 when returned __int64 to int (if that was not a fluctuation).

Listen here. During one meal Ivan can save about 2*10^6/3 ~ 666667 rub. This is maximum increment of saved money. So at maximum the saved sum will be 2*10^9 + 666667, which is much less than 2^31-1.

My trouble (and most likely yours too) was connected with that i checked if saved sum is strictly greater than n fogetting of the fractional part. This is the case when
( integer part of saved money == n)
BUT
( integer part == n AND fractional part > 0)
Re: hint about WA#11
Posted by alexey saybel 1 Feb 2010 15:04
thx