比赛 |
NOIP2008集训模拟3 |
评测结果 |
WWWWWWWWWA |
题目名称 |
移动骷髅 |
最终得分 |
10 |
用户昵称 |
E.M.B.E.R |
运行时间 |
0.000 s |
代码语言 |
Pascal |
内存使用 |
0.00 MiB |
提交时间 |
2008-11-12 10:55:33 |
显示代码纯文本
program EmberAsh;
type node=record
redx:integer;
redy:integer;
xx:array[1..5,1..5]of integer;
redf:integer;//红骷髅面对的方向 0天上1左2右3上4下
flag:boolean;//红色方格四周是否有别的小骷髅
end;
var
i,j,k,m,n,min:longint;
a:node;
fin,fout:text;
{procedure try(o,step:node);
var
i,j,k,s1:longint;
o1:node;
begin
with o do
begin
if (redx=3)and(redy<=2)and(xx[3,4]=1) then
if step+1<min then min:=step+1 else
if (redx<=2)and(redy=3)and(xx[4,3]=1) then
if step+1<min then min:=step+1 else
if (redx>=4)and(redy=3)and(xx[3,2]=1) then
if step+1<min then min:=step+1 else
if (redx=3)and(redy>=4)and(xx[2,3]=1) then
if step+1<min then min:=step+1
else
begin
end;
end;
end;}
BEGIN
assign(fin,'klgame.in');reset(fin);
assign(fout,'klgame.out');rewrite(fout);
readln(fin,n);
with a do
for k:=1 to n do
begin
//with a do
for i:=1 to 5 do
for j:=1 to 5 do
begin
read(fin,xx[i,j]);
if xx[i,j]=2 then
begin
redx:=i;redy:=j;
end;
end;
if (xx[3,4]=1)or(xx[4,3]=1)or(xx[3,2]=1)or(xx[2,3]=1) then
flag:=true;
min:=maxlongint;
{try(a,0);}
writeln(fout,'level ',k,':');
writeln(fout,k);
end;
close(fin);close(fout);
END.