比赛 |
20101116 |
评测结果 |
WWWWWWWWWW |
题目名称 |
打砖块 |
最终得分 |
0 |
用户昵称 |
苏轼 |
运行时间 |
0.000 s |
代码语言 |
Pascal |
内存使用 |
0.00 MiB |
提交时间 |
2010-11-16 11:28:46 |
显示代码纯文本
program gamea(input,output);
type
re=record
f:integer;
c:byte;
end;
var
n,m,k,i,j,ii:integer;
ch:char;
map:array[-201..201,-200..201]of re;
sum:array[-201..201,-200..201]of integer;
f:array[-201..201,-200..201]of integer;
begin
assign(input,'gamea.in');
reset(input);
assign(output,'gamea.out');
rewrite(output);
readln(n,m,k);
for i:=1 to n do
for j:=1 to m do
begin
read(map[i,j].f,ch);
read(ch);
if ch='N' then
map[i,j].c:=0
else
map[i,j].c:=1;
end;
{ for i:=1 to m do
for j:=k downto 1 do
if map[j,i].c=1 then
begin
map[j-1,i].f:=map[j-1,i].f+map[j,i].f;
for ii:=j downto 1 do
map[ii,i]:=map[ii-1,i];
end;}
for i:=1 to m do
for j:=1 to k do
sum[i,j]:=sum[i,j-1]+map[n-j+1,i].f;
for i:=1 to m do
for j:=0 to k do
for ii:=0 to j do
if f[i-1,j-ii]+sum[i,ii]>f[i,j] then
f[i,j]:=f[i-1,j-ii]+sum[i,ii];
writeln(f[m,k]);
close(input);
close(output);
end.