记录编号 131660 评测结果 TAATT
题目名称 爱上捉迷藏 最终得分 40
用户昵称 GravatarFoolMike 是否通过 未通过
代码语言 Pascal 运行时间 0.003 s
提交时间 2014-10-24 19:34:12 内存使用 0.22 MiB
显示代码纯文本
var
n,m,i,j,shu:longint;
f:array[-7..107,-7..107]of longint;
z:array[1..100,1..100]of char;
s:ansistring;
begin
assign(input,'kadun.in');
assign(output,'kadun.out');
reset(input);
rewrite(output);
readln(n,m);
shu:=n*m;
for m:=1 to m do
  begin
  readln(s);
  for n:=1 to n do
    begin
    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 f[m,n]=shu then
  begin
  writeln(n,' ',m);
  exit;
  end;
close(input);close(output);
end.