|
|
вернуться в форумWhy memory limit var n,i,j,k:integer; b,c:array[1..7500] of integer; a:array[1..7500,1..7500] of integer; begin n:=0; while not eoln do begin inc(n); read(c[n]); inc(b[c[n]]); k:=c[n]; end; i:=1;j:=1; while (i<=k)and(j<=n) do begin while b[i]>0 do inc(i); a[c[j],i]:=1; a[i,c[j]]:=1; b[i]:=maxint; if b[c[j]]>0 then dec(b[c[j]]); if i>c[j] then i:=c[j]; inc(j); if (i=k)and(b[k]=1) then break; end; for i:=1 to k do begin write(i,':'); for j:=1 to k do if a[i,j]=1 then write(' ',j); writeln; end; end. Re: Why memory limit a:array[1..7500,1..7500] of integer; sizeof(a) = 7500*7500*4 > 200 MB! |
|
|