ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1587. Летающая свинья

Why WA #14
Послано LittlePig 28 окт 2007 13:50
Help me, please.. Thanks..
Re: Why WA #14
Послано svr 29 окт 2007 22:10
Because you passed 14 test with BigNum you is Ok therefore
you have problem with logic of the task.
In this situation simple but clever test may help
and they easy to produce if having AC.
Try the next:
15
1 -1 0 2 -2 0 3 -1 0 0 -3 -3 2 0 1
Ans=18
and this one:
11
-1 0 -1 0 -3 0 -1 0 0 0 -2
Ans=0

Edited by author 29.10.2007 22:39
Re: Why WA #14
Послано Giorgi Saghinadze (Tbilisi SU) 30 окт 2007 15:42
I used big numbers only for printing answer.
I like my solution :)
Re: Why WA #14
Послано Denis Koshman 20 июл 2008 19:25
Got WA14 too... But currently I use big numbers for temporary calculations.
Re: Why WA #14
Послано Denis Koshman 20 июл 2008 19:36
Got AC. The problem was with long arithmetics. I wrote it modulo 10000, and it started overflowing after squaring because number of digits also must be taken into consideration. After reverting to modulo 1000, it worked fine.

Try test with 50000 of 3s, check if you do not get negatives in the answer.