|
|
back to boardSomething's wrong with "Memory Limit" 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... 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... > 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... > 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! |
|
|