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

Обсуждение задачи 1313. К вопросу о спорте

100*100 not enough?
Послано $wordfish 9 июл 2012 23:57
So the problems says that 1 <= N <= 100, so I declare a nice unsigned char mem[100*100].
I get WA on test 4.
I go and read all the discussion about wrong awsers but none of those offer anything I didn't figure out already.
I change the declaration to unsigned char mem[256*256] and voila, the solution is magically accepted.
Does anyone have an idea why 100*100 bytes aren't enough?
Re: 100*100 not enough?
Послано Artem Khyzha 10 июл 2012 08:16
I wrote a solution in Pascal (ages ago :-)), which AFAIR checks whether index is in range while accessing to some element in array. And I had [1..100,1..100]. That is why I suppose that somewhere in your program you access out of array.
Re: 100*100 not enough?
Послано Bogatyr 16 сен 2012 16:44
100x100 is enough, assuming you start your indexing at 0 and end at n-1