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

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

Something's wrong with "Memory Limit"
Послано Vladimir Milenov Vasilev 28 ноя 2001 00:24
const max=250000;
var i,j,divid,n,pospred,apom,bpom:longint;
    a:array[0..max]of integer;
    pom,sum:integer;
    modd,ach,bch:byte;
With these variables I got "Memory Limit". Is it possible?
Is it possible such an input:
3
0 0
3 4
3 4
Please, tell me! Thank you!
Oh, yes, it is possible. This is because any pascal compiler uses some extra memory and your program has less then 1000 indeed. Read message...
Послано shitty.Mishka 28 ноя 2001 01:24
Actually, you don't need to store any numbers in arrays.
You can simply print the sum while reading, you just have
to remember some numbers in a few variables. Email me to
shelding@zeos.net if you need more hints...
Re: Oh, yes, it is possible. This is because any pascal compiler uses some extra memory and your program has less then 1000 indeed. Read message...
Послано Vladimir Milenov Vasilev 28 ноя 2001 01:57
> Actually, you don't need to store any numbers in arrays.
> You can simply print the sum while reading, you just have
> to remember some numbers in a few variables. Email me to
> shelding@zeos.net if you need more hints...

Is it possible my program to use more than 400 K extra
memory?
Re: Oh, yes, it is possible. This is because any pascal compiler uses some extra memory and your program has less then 1000 indeed. Read message...
Послано Vladimir Milenov Vasilev 28 ноя 2001 02:24
> Actually, you don't need to store any numbers in arrays.
> You can simply print the sum while reading, you just have
> to remember some numbers in a few variables. Email me to
> shelding@zeos.net if you need more hints...
Thank you! I tried your idea and got accepted. I thought I
can't read input and write output at the same time... I'm
so pleased I learned something new about Timus. Thanks
again!
Congratulations! And good luck!
Послано shitty.Mishka 28 ноя 2001 02:31