|
|
back to boardHelp me - I get memory limit exceeded!!!! 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!!!! because Pascal compiler here is Delphi, sizeof(Integer) = 4 Re: You must use "Smallint" instead of "Integer" !!! > 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 Posted by Aidar 10 Feb 2002 21:07 Usually i write: type integer = -32767..32768; Good luck! |
|
|