ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1048. Superlong Sums

Something's wrong with "Memory Limit"
Posted by Vladimir Milenov Vasilev 28 Nov 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...
Posted by shitty.Mishka 28 Nov 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...
Posted by Vladimir Milenov Vasilev 28 Nov 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...
Posted by Vladimir Milenov Vasilev 28 Nov 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!
Posted by shitty.Mishka 28 Nov 2001 02:31