Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- a:array[1..1000, 1..1000] of boolean;
- b:array[1..1000, 1..1000] of boolean;
- c:array[1..1000, 1..1000] of integer;
- d:array[1..10] of boolean;
- m,t,n,i,j,p,k:longint;
- procedure max(x,y:longint);
- begin
- b[x,y]:=true;
- if (x>1) and (b[x-1,y]=false) and (a[x-1,y]=true)then
- max((x-1),y);
- if (y>1) and (b[x,y-1]=false) and (a[x,y-1]=true) then
- max(x,(y-1));
- if (y<n) and (b[x,y+1]=false) and (a[x,y+1]=true) then
- max (x,(y+1));
- if (x<m) and (b[x+1,y]=false) and (a[x+1,y]=true) then
- max(x+1,y);
- end;
- begin
- randomize;
- read(m,n);
- for i:=1 to m do
- for j:=1 to n do
- c[i,j]:=random(9);
- for k:=1 to 1023 do
- begin
- k:=0;
- for i:=1 to 10 do
- if k and (1 shl i)=true then
- begin
- k:=k+1;
- d[i]:=true
- end
- else d[i]:=false;
Add Comment
Please, Sign In to add comment