- 琵琶湖
- 2016-03-24 22:00:28 @
评测结果
编译成功
Free Pascal Compiler version 3.0.0 [2015/11/16] for i386
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling foo.pas
Linking foo.exe
58 lines compiled, 0.0 sec, 28416 bytes code, 1300 bytes data
C++
测试数据 #0: Accepted, time = 15 ms, mem = 16480 KiB, score = 5
测试数据 #1: TimeLimitExceeded, time = 2046 ms, mem = 16480 KiB, score = 0
测试数据 #2: TimeLimitExceeded, time = 2109 ms, mem = 16476 KiB, score = 0
测试数据 #3: TimeLimitExceeded, time = 2109 ms, mem = 16480 KiB, score = 0
测试数据 #4: TimeLimitExceeded, time = 2046 ms, mem = 16480 KiB, score = 0
测试数据 #5: TimeLimitExceeded, time = 2109 ms, mem = 16480 KiB, score = 0
测试数据 #6: TimeLimitExceeded, time = 2046 ms, mem = 16480 KiB, score = 0
测试数据 #7: TimeLimitExceeded, time = 2078 ms, mem = 16480 KiB, score = 0
测试数据 #8: TimeLimitExceeded, time = 2093 ms, mem = 16480 KiB, score = 0
测试数据 #9: TimeLimitExceeded, time = 2078 ms, mem = 16476 KiB, score = 0
测试数据 #10: TimeLimitExceeded, time = 2093 ms, mem = 16480 KiB, score = 0
测试数据 #11: TimeLimitExceeded, time = 2015 ms, mem = 16480 KiB, score = 0
测试数据 #12: TimeLimitExceeded, time = 2125 ms, mem = 16480 KiB, score = 0
测试数据 #13: TimeLimitExceeded, time = 2062 ms, mem = 16480 KiB, score = 0
测试数据 #14: TimeLimitExceeded, time = 2078 ms, mem = 16484 KiB, score = 0
测试数据 #15: TimeLimitExceeded, time = 2156 ms, mem = 16480 KiB, score = 0
测试数据 #16: TimeLimitExceeded, time = 2078 ms, mem = 16484 KiB, score = 0
测试数据 #17: TimeLimitExceeded, time = 2078 ms, mem = 16480 KiB, score = 0
测试数据 #18: TimeLimitExceeded, time = 2046 ms, mem = 16484 KiB, score = 0
测试数据 #19: TimeLimitExceeded, time = 2015 ms, mem = 16480 KiB, score = 0
TimeLimitExceeded, time = 39475 ms, mem = 16484 KiB, score = 5
代码
pascal
const
dx:array[1..4]of longint=(1,-1,0,0);
dy:array[1..4]of longint=(0,0,-1,1);
type
rec=record
x,y:longint;
end;
var
i,j,k,n,m,t,x,ans:longint;
map,a:array[0..1001,0..1001]of longint;
procedure bfs(i,j:longint);
var
h,r,ii:longint;
q:array[0..1000001]of rec;
begin
h:=0;r:=1;
q[1].x:=i;q[1].y:=j;
map[i,j]:=0;
while h<r do
begin
inc(h);
for ii:=1 to 4 do
if map[q[h].x+dx[ii],q[h].y+dy[ii]]>0 then
begin
inc(r);
q[r].x:=q[h].x+dx[ii]; q[r].y:=q[h].y+dy[ii];
map[q[r].x,q[r].y]:=0;
end;
end;
end;
begin
readln(n,m);
for i:=1 to n do
begin
for j:=1 to m do read(a[i,j]);
readln;
end;
readln(t);
for k:=1 to t do
begin
read(x);
map:=a;
ans:=0;
for i:=1 to n do
for j:=1 to m do
begin
map[i,j]:=map[i,j]-x;
if map[i,j]<0 then map[i,j]:=0;
end;
for i:=1 to n do
for j:=1 to m do
if map[i,j]>0 then
begin
inc(ans);
bfs(i,j);
end;
write(ans,' ');
end;
end.
0 条评论
信息
- ID
- 1944
- 难度
- 7
- 分类
- (无)
- 标签
- 递交数
- 648
- 已通过
- 112
- 通过率
- 17%
- 被复制
- 5
- 上传者