⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ac1191.pas

📁 某牛人写的acm.tongji.edu.cn上大部分ac的代码,仅供学习研究,请不要用来作弊
💻 PAS
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -