讨论 / Who Can Help me??....
webeskycn 2010-07-25 07:47:00
点我顶贴 收藏 删除
状态: Unaccepted

测评机: Xeost[5]

得分: 0分

提交日期: 2009-5-7 22:41:00

有效耗时: 该状态没有记录

测试结果1: 运行错误|普通保护错误

测试结果2: 运行错误|普通保护错误

测试结果3: 运行错误|普通保护错误

测试结果4: 运行错误|普通保护错误

测试结果5: 运行错误|普通保护错误

测试结果6: 运行错误|普通保护错误

测试结果7: 运行错误|普通保护错误

测试结果8: 运行错误|普通保护错误

测试结果9: 运行错误|普通保护错误

测试结果10: 运行错误|普通保护错误

who can tell me why....

program jjjy;

const

hx:array[1..4]of shortint=(-1,0,1,0);

hz:array[1..4]of shortint=(0,1,0,-1);

type

jl=record

xx,yy:longint;

fa:longint;

end;

var

n,js:longint;

sx,sy,ex,ey:longint;

oppen,cllose:longint;

x:array[0..1000000]of jl;

b:array[0..6010,0..6010]of longint;

s:ansistring;

procedure init;

var

i,j:longint;

begin

fillchar(b,sizeof(b),0);

js:=0;

cllose:=1;

oppen:=1;

x[cllose].fa:=0;

read(n);

for i:=1 to n do

begin

readln(s);

for j:=1 to n do

if s[j]=’1’ then b[i,j]:=1;

end;

readln(sx,sy);

readln(ex,ey);

x[cllose].xx:=sx;

x[cllose].yy:=sy;

b[ex,ey]:=0;

end;

procedure print(l:longint);

begin

if l=0 then exit;

print(x[l].fa);

inc(js);

end;

function same(xxx,yyy:longint):boolean;

var

i:longint;

begin

for i:=1 to oppen do

if (x[i].xx=xxx)and(x[i].yy=yyy) then exit(true);

exit(false);

end;

procedure search;

var

i:longint;

il,jl:longint;

begin

repeat

for i:=1 to 4 do

begin

il:=x[cllose].xx+hx[i];

jl:=x[cllose].yy+hz[i];

if (il in [1..n])and(jl in[1..n])and(b[il,jl]=0)and(not(same(il,jl)))and(b[il,jl]=0) then

begin

inc(oppen);

b[il,jl]:=1;

x[oppen].xx:=il;

x[oppen].yy:=jl;

x[oppen].fa:=cllose;

if (x[oppen].xx=ex)and(x[oppen].yy=ey) then

begin

print(oppen);

writeln(js-1);

halt;

end;

end;

end;

inc(cllose);

until cllose>=oppen;

end;

begin

init;

search;

end.

各位指点一下了啊。。。~~~

谢谢啊。。。

#1 webeskycn@2009-05-08 06:38:00
回复 删除
来人那。。。~~

#2 Aule@2009-05-08 20:32:00
回复 删除
普通保护错误

比如数组读超了,数据溢出了,都是这个

#3 Aule@2009-05-08 20:32:00
回复 删除
对,还有输入数据读错了也是
#4 tzh@2010-07-25 07:47:00
回复 删除
ME TOO

我好歹过了第一个点

后面和你一样

查看更多回复
提交回复