- 清帝之惑之顺治
- 2009-03-16 18:59:29 @
编译通过...
├ 测试数据 01:答案正确... 40ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:运行超时...
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Unaccepted 有效得分:90 有效耗时:40ms
var a,b:array[0..501,0..501] of longint;
i,j,k,s,l,hang,lie:longint;
procedure try(x,y,sum:longint);
var i,j,l:longint;
{if b[x,y]0 then
begin s:=sum+b[x,y]+1; end else}
begin
if (x1) and(a[x,y]>a[x-1,y]) then try(x-1,y,sum+1);
if (xhang)and(a[x,y]>a[x+1,y]) then try(x+1,y,sum+1);
if (y1) and(a[x,y]>a[x,y-1]) then try(x,y-1,sum+1);
if (ylie) and(a[x,y]>a[x,y+1]) then try(x,y+1,sum+1);
b[x,y]:=sum+1;
{if kk then k:=sum+1;
end;
begin
readln(hang,lie);
for i:=1 to hang do
begin
for j:=1 to lie do
read(a);
readln;
end;
fillchar(b,sizeof(b),0);
for i:=1 to hang do
for j:= 1 to lie do
try(i,j,0);
writeln(k);
end.