|
|
вернуться в форумI get MLE using only 600 Kb (without pointers). Can someone explaine it??? Послано Kit 14 мар 2005 21:34 I get memory limit exceed using only 600 Kb (without pointers). Can someone explaine it??? There is part of my program. {$APPTYPE CONSOLE} {$R+,Q+} program ural1037; const mem_max = 30001; delay = 600; type node = record parent, left, right: longint; min, time: longint; end; var tree: array [0..mem_max] of node; root: longint; time, num: longint; ch: char; procedure ... If you use recursion, it can fall in "perpetual cycle", so, on every call it eats memory, and You get MLE before Stack Overflow... (-) Послано Heaven 15 мар 2005 02:29 Re: If you use recursion, it can fall in "perpetual cycle", so, on every call it eats memory, and You get MLE before Stack Overflow... (-) Послано Kit 15 мар 2005 21:58 I have got AC, replacing some "integer" by "word" only, saving 120 Kb on it. So, there is no "perpetual cycle". Stack are used very small (less then 1Kb). Some other assumptions? Edited by author 15.03.2005 21:58 |
|
|