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

Обсуждение задачи 1992. CVS

Memory limit exceeded
Послано Nataraj 23 мар 2014 18:03
I am writing my solution in Java and I constantly getting "Memory Limit Exceeded" error
on 10th test.

I used ArrayList<Integer> to store 'programs' and 'rollbacks'.
Then lately I changed it TIntArrayList, to store 'int' as a basic type,
but still it does not solve the problem.

I saw solutions in Java, that people used less than 10Mb of memory.
What am I doing wrong?

Edited by author 23.03.2014 18:03

Edited by author 23.03.2014 18:04
Re: Memory limit exceeded
Послано Nataraj 23 мар 2014 20:50
Fully rewrote the algorithm, to calculate the solution each time in runtime, without using memory for each clone, but then my solutions exceeds Time limitation on 9th test.
I also do not understand why we get a number 'm' - number of educational program.
How this number could help us to solve the problem?
Re: Memory limit exceeded
Послано Nataraj 24 мар 2014 14:52
Finally solved it. The main trick was to find a way to make clone operation without coping all the clone memory.