记录编号 130510 评测结果 AAAAT
题目名称 爱上捉迷藏 最终得分 80
用户昵称 Gravatarhelloworld123 是否通过 未通过
代码语言 Pascal 运行时间 0.002 s
提交时间 2014-10-22 16:46:22 内存使用 0.21 MiB
显示代码纯文本
program cogs1755;
const
 maxn=107;
var
 i,j,n,m,max,x,y:longint;
 f:array[-7..maxn,-7..maxn] of longint;
 s:char;
procedure zuo(s:char);
var
  k,l,r:longint;
  s1:char;
begin
  s1:=s;
  case s1 of
   'N': begin
         for k:=i-3 to i+3 do
		  for l:=j-3 to j+3 do
		   inc(f[k,l]);
		end;
    'C':begin
	     for k:=i-2 to i+2 do
		  for l:=j-2 to j+2 do
		   inc(f[k,l]);
	    end;
    'Z':begin
	     for k:=i-1 to i+1 do
		  for l:=j-1 to j+1 do
		   inc(f[k,l]);
	    end;
    'X':inc(f[i,j]);
   end;

end;

begin
 assign(input,'kadun.in'); reset(input);
 assign(output,'kadun.out'); rewrite(output);
   readln(n,m);
   fillchar(f,sizeof(f),0);
   for i:=1  to m do
   begin
    for j:=1 to n do
	begin
	 read(s);
	 zuo(s);
	end;
	 readln;
   end;
    max:=-maxlongint;
   for i:=1 to m do
    for j:=1 to n do
	 if f[i,j]>max then
	  begin
	   max:=f[i,j];
	   x:=i; y:=j;
	  end;
	writeln(y,' ',x);
 close(input); close(output);
end.