记录编号 |
132112 |
评测结果 |
AAAAW |
题目名称 |
爱上捉迷藏极限关卡 |
最终得分 |
80 |
用户昵称 |
FoolMike |
是否通过 |
未通过 |
代码语言 |
Pascal |
运行时间 |
0.032 s |
提交时间 |
2014-10-25 13:17:08 |
内存使用 |
2.15 MiB |
显示代码纯文本
var
n,m,i,j,shu,k,g,l:longint;
f:array[-7..1012,-7..1012]of byte;
z:array[-7..1012,-7..1012]of char;
ans:array[1..10,1..2]of longint;
s:ansistring;
begin
assign(input,'kadundudu.in');
assign(output,'kadundudu.out');
reset(input);
rewrite(output);
readln(n,m,k);
shu:=n*m;
for m:=1 to m do
begin
readln(s);
if s<>'' then
for n:=1 to n do
begin
z[m,n]:=s[n];
{if z[m,n]<>'X' then writeln(m,' ',n,' ',z[m,n]);}
if s[n]='X' then dec(shu);
if s[n]='N' then
for i:=m-3 to m+3 do
for j:=n-3 to n+3 do
if (i<>m)or(j<>n) then
inc(f[i,j]);
if s[n]='C' then
for i:=m-2 to m+2 do
for j:=n-2 to n+2 do
if (i<>m)or(j<>n) then
inc(f[i,j]);
if s[n]='Z' then
for i:=m-1 to m+1 do
for j:=n-1 to n+1 do
if (i<>m)or(j<>n) then
inc(f[i,j]);
end;
end;
for m:=1 to m do
for n:=1 to n do
if (z[m,n]='X')and(f[m,n]>0) then
begin
if g<>k then
begin
inc(g);ans[g,1]:=m;ans[g,2]:=n;
end;
if g=k then
begin
l:=1;
for g:=2 to g do
if f[ans[g,1],ans[g,2]]<f[ans[l,1],ans[l,2]] then l:=g;
if f[ans[l,1],ans[l,2]]<f[m,n] then
begin
for i:=l to g-1 do
begin
ans[i,1]:=ans[i+1,1];ans[i,2]:=ans[i+1,2];
end;
ans[k,1]:=m;ans[k,2]:=n;
end;
end;
end;
for k:=1 to k do
writeln(ans[k,2],' ',ans[k,1]);
close(input);close(output);
end.