测评机: Xeost[5]
得分: 70分
提交日期: 2010-7-26 20:19:00
有效耗时: 1265毫秒
测试结果1: 通过本测试点|有效耗时172ms
测试结果2: 测试结果错误.错误结果为:0000000000
0000000011
0010000001
0001000000
0001000000
正确结果应为:0000100010
0000100010
0000000100
0000000000
0000000000
测试结果3: 测试结果错误.错误结果为:00001100000000000000000100000000000000000000000000
00010010000000000000000110000000000000000000000000
00010010000000000000000100000111000001110000000000
00010110000000000000000000100101000011110000000000
01000110000100000000000000010110000011000000000000
01001110000000000000000000011000000000000000000000
00000000000000000000000000000000000000000000000000
正确结果应为:00000000110000000001100000000000000000000000000000
00000001101000000100010000000110110000000000110000
00010110000100000100000000000110000100000000000000
00011010001000001100110000000100000000000000000000
01011110000000000000000000000101000011110000000000
00000100000000000000000000000101101100001000000000
00000010000000000000000000000010000001001000000000
测试结果4: 测试结果错误.错误结果为:00000000000000000000000000000000000000000000000000001100000000000000000000000000
00000000000011011000000000000000000000000000000000001011000000000000000000000001
00000000000110011000000000000000000000000000000000010111000000000000000000000011
00000011100101101100000000000000000000011000000000001011000000000000001000000111
00000010100011001000000000000000000001110000000000001100000000000000000000001001
00000100000101001100000000000000000010000000000000000000000000000000000000000100
00000101000010000000000000000000000000100000000000000000000000000000000000010100
00101011100000000000000000000000000000000000000000000000000000000000000000001000
00100000100000000000000000000000000000000000000000000000000000000000000000000000
00110101000000000000000000000000000000000000000000000000000000000000000000000000
正确结果应为:00000000000000000000000000000000101000000000000000000000000000000000000101000000
00010100000100000011000000000110101000000000000000000000000000000001101001000000
00001110001010000011000000000001010000000110000000000000000000000001101000000000
00000111110001000010100000000000000000000101000000000000000000101100001100000000
00000101110101100100100000000000000000000001100000000000000000111000011000000000
00001100110100100011000000000000000000110000000110000000000001110000100000001100
00001100000100100000000001000000000001001010001001000000000001000101110000001100
00100000000111000000000110000000000000110000000101000000001110000101111000000000
00100100000000000000000011000000000000000000000010000000010000001010000100000000
00011100000000000000000000000000000000000000000000000000000000000111110100000000
测试结果5: 通过本测试点|有效耗时171ms
测试结果6: 通过本测试点|有效耗时172ms
测试结果7: 通过本测试点|有效耗时172ms
测试结果8: 通过本测试点|有效耗时187ms
测试结果9: 通过本测试点|有效耗时187ms
测试结果10: 通过本测试点|有效耗时204ms
提交代码:
var i,j,n,m,t,x,tt:longint;cc:char;
a,b:array[1..100,1..100]of 0..1;
begin
readln(m,n,t);
for i:=1 to n do
begin
for j:=1 to m do
begin
read(cc);
if cc='0' then b[i,j]:=0;
if cc='1' then b[i,j]:=1;
end;
readln;
end;
for x:=1 to t do
begin
for i:=1 to n do
for j:=1 to m do a[i,j]:=b[i,j];
for i:=1 to n do
for j:=1 to m do
begin
tt:=0;
if (i>1)and(j>1)then tt:=tt+a[i-1,j-1];
if i>1 then tt:=tt+a[i-1,j];
if (i>1)and(j<n)then tt:=tt+a[i-1,j+1];
if j>1 then tt:=tt+a[i,j-1];
if j<n then tt:=tt+a[i,j+1];
if (i<n)and(j>1)then tt:=tt+a[i+1,j-1];
if i<n then tt:=tt+a[i+1,j];
if (i<n)and(j<n)then tt:=tt+a[i+1,j+1];
if a[i,j]=0 then
if tt=3 then b[i,j]:=1 else b[i,j]:=0
else
if (tt=2)or(tt=3) then b[i,j]:=1 else b[i,j]:=0;
end;
end;
for i:=1 to n do
begin
for j:=1 to m-1 do write(a[i,j]);
writeln(a[i,m]);
end;
end.