|
|
вернуться в форумFor AC. 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. Послано hatred 9 июл 2011 21:57 thx Re: For AC. Послано S.77 5 авг 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. Thanks helped very much!!!! |
|
|