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!

For AC.
Posted by ilya_romanenko 13 Jun 2011 23:19
If you have WA, you must use long long(or int64 in Pascal).And don't use sum/3>n,use sum>n*3.After that you have AC.
По русски.
Не используйте типы int(или integer). Используйте типы int64(или long long). При сравнение не сумма/3>выхода,а сумма>выход*3. Желаю всем красивых AC!

P.S. Sorry for bad English.
Re: For AC.
Posted by hatred 9 Jul 2011 21:57
thx
Re: For AC.
Posted by S.77 5 Aug 2011 03:02
Well, this method guarantee you simple AC solution, but to decrease time and get finally 0.015 secs you should come back to 32-bit ints. Keep somewhere the undivided part (the remainder) and try to eliminate it with each new value read. At the time you compare the sum to N (or the remains of N to zero) you should not forget the remainder. Write something as "if(n<0||!n&&r)" in the place of condition.
Re: For AC.
Posted by amirani 7 Aug 2012 19:13
Thanks helped very much!!!!