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

Common Board

ADMINS....PLEASE HELP ME...
Posted by ZiV 12 Jan 2006 18:27
How could got MLT on test 3 if i use static structures..
{$APPTYPE CONSOLE}
Var
 a : array[1..1000] of longint;
 b : array[0..100000] of longint;
 c : array[0..100000] of word;
 n,i,x,y,fl : longint;
 st : string;

Edited by author 12.01.2006 18:45
Yes, it is possible (+)
Posted by Dmitry 'Diman_YES' Kovalioff 12 Jan 2006 21:40
Memory for static structure is not allocated immediately after the program is launched. To force this allcation you should initialize your static variables yourself:

FillChar(a,SizeOf(a),0);
FillChar(b,SizeOf(b),0);
FillChar(c,SizeOf(c),0);
n:=0; i:=0; x:=0; y:=0; fl:=0;
st:='';

And you will get MLE(1) ;)
Re: ADMINS....PLEASE HELP ME...
Posted by wwwwww 13 Jan 2006 00:00
Also if you think that in this program you use ~600K
you are wrong (you use about 700K-800K).
So if ML=750K you have chance to get MLE.
Yes, more memory will be allocated. Read FAQ about memory allocation (-)
Posted by Dmitry 'Diman_YES' Kovalioff 13 Jan 2006 00:25


Edited by author 13.01.2006 00:26