- 海战
- 2009-08-16 14:34:47 @
什么东西啊,就第10个出问题,还不说哪行的问题,搞我一个中午了,牛人请帮帮忙吧,到底是什么的问题,我看网上说什么存取非法,但是我读入都没问题啊,数组开大了100都还是错……
鄙视vijos不公开测试数据……
var i,j,k,l,x,y,h,w,n,r,c:integer;
s:string;
no:boolean;
sea:array[-100..300,-100..300]of boolean;
begin
readln(r,c);
fillchar(sea,sizeof(sea),false);
for i:=1 to r do begin
readln(s);
for j:=1 to c do begin
if(s[j]='#')then sea:=true;
end;
end;
no:=false;
for i:=1 to r-1 do begin
for j:=1 to c-1 do begin
k:=0;
if(sea)then inc(k);
if(sea)then inc(k);
if(sea)then inc(k);
if(sea)then inc(k);
if(k=3)then begin
no:=true;
break;
end;
end;
if(no)then break;
end;
if(no)then writeln('Bad placement.')
else begin
n:=0;
for i:=1 to r do begin
for j:=1 to c do begin
if(sea)then begin
n:=n+1;
x:=0;
y:=0;
h:=i;
w:=j;
if(sea)then x:=-1;
if(sea)then x:=1;
if(sea)then y:=-1;
if(sea)then y:=1;
if(x0)or(y0)then begin
while (h>0)and(h0)and(w
2 条评论
-
ERICFXY LV 8 @ 2014-07-31 18:36:49
人品……
-
2013-12-17 20:32:51@
language barrier
- 1