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

Обсуждение задачи 1220. Stacks

Илья Гофман (Ilya Gofman) why memory limit? [4] // Задача 1220. Stacks 29 мар 2004 17:21
if i declare

type StackR=array[1..100000] of ^longint;
type Stack=^StackR;
var m:array[1..1000] of Stack;

does this mean that my program has used 100000x1000x4 = 4x10^9bytes? together with the fact that my variables are dynamic and I call the new() procedure not more than for 100000 longints?
Vladimir Yakovlev (USU) Re: why memory limit? [3] // Задача 1220. Stacks 29 мар 2004 19:58
> not more than for 100000 longints?

plus not more than 100000 pointers (4 byte)

total: 800K of data => MLE
Илья Гофман (Ilya Gofman) Re: why memory limit? [2] // Задача 1220. Stacks 30 мар 2004 19:57
thx, but then how do i make it? the actual part of the problem is nothing hard...
buggzy Re: why memory limit? // Задача 1220. Stacks 30 мар 2004 22:55
Use another data presentation and O(n*n) algorithm instead of O(n).
Vladimir Yakovlev (USU) Re: why memory limit? // Задача 1220. Stacks 31 мар 2004 00:11
The actual part of this problem is to do it in 750K