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 1097. Square Country 2

memory limit exceeded#13, here is my code!!!!
Posted by Bobur 8 Mar 2008 12:35
i need help, pls!!
how i can solve this problem with another way

   var
   a : array [1..10000, 1..10000] of byte;
   n, min : byte;
   i, j, k, i1, L, Lpark, x, y, eni : word;

begin
   read(L, Lpark);
   read(n);
   for i := 0 to n-1 do
     begin
       read(min, eni, x, y);
       for j := 0 to eni-1 do
       for k := 0 to eni-1 do
       a[x+j, y+k] := min;
     end;
   L := L - Lpark;
   min := 255;
   for i := 0 to L do
   for j := 0 to L do
     begin
       n := 1;
         for k := 1 to Lpark do
         for i1 := 1 to Lpark do
           if n < a[k+i, i1+j] then n := a[k+i, i1+j];
       if min > n then min := n;
     end;
  if min > 100 then writeLn('IMPOSSIBLE')
  else writeLn(min);
end.
thx.