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

Обсуждение задачи 1048. Сверхдлинные суммы

Help me - I get memory limit exceeded!!!!
Послано Michael Medvedev (KNU training center) 5 янв 2002 20:53
I use res:array[0..250001] of integer keeping four digits in each
element of array (in one integer I keep numbers from 0 to 9999 - four
digits). In total I use 250002 * 2 = 500004 bytes (500004 / 1024 =
489K) - it's less then 1000K, but in online status I see that my
program uses 1052K. What's the matter?

Here is my all part of variable definition:

const mx = 250001;
var am,temp,cur,i,j,n:longint;
    res:array[0..mx] of integer;
    carry,k,l,a,b:word;

Ok, tell me, please to medv@roller.ukma.kiev.ua how to solve this
problem without arrays.
Re: Help me - I get memory limit exceeded!!!!
Послано I have answers to all your questions :) 5 янв 2002 22:31
because Pascal compiler here is Delphi, sizeof(Integer) = 4
Re: You must use "Smallint" instead of "Integer" !!!
Послано Happy New Year! Russia. 6 янв 2002 00:51
> I use res:array[0..250001] of integer keeping four digits in each
> element of array (in one integer I keep numbers from 0 to 9999 -
four
> digits). In total I use 250002 * 2 = 500004 bytes (500004 / 1024 =
> 489K) - it's less then 1000K, but in online status I see that my
> program uses 1052K. What's the matter?
>
> Here is my all part of variable definition:
>
> const mx = 250001;
> var am,temp,cur,i,j,n:longint;
>     res:array[0..mx] of integer;
>     carry,k,l,a,b:word;
>
> Ok, tell me, please to medv@roller.ukma.kiev.ua how to solve this
> problem without arrays.
>
>
Read this
Послано Aidar 10 фев 2002 21:07
Usually i write:
type
  integer = -32767..32768;

Good luck!