ac1191.pas
来自「某牛人写的acm.tongji.edu.cn上大部分ac的代码,仅供学习研究,请」· PAS 代码 · 共 31 行
PAS
31 行
program tju1191;
const
maxt=1100;
maxw=101;
var
score:array[0..maxt,-1..maxw]of longint;
w,h,a,b,c,d,m,time:longint;
begin
repeat
fillchar(score,sizeof(score),0);
read(w,h);dec(h);time:=1;
repeat
read(a,b,c,d);
if b=0 then break;
if h mod c>0 then continue;
inc(a,h div c);
inc(score[a,b],d);
if a>time then time:=a;
until false;
for a:=time-1 downto 0 do
for b:=1 to w do begin
m:=0;
for c:=-2 to 2 do
if score[a+1,b+c]>m then m:=score[a+1,b+c];
inc(score[a,b],m);
end;
writeln(score[0,w shr 1+1]);
until seekeof;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?