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

📄 ac1092.pas

📁 同济大学 Online在线题库 AC源代码合集 程序设计竞赛必看资料
💻 PAS
字号:
program tju1092;
const
  maxsalary=10000;
var
  len:array[1..maxsalary]of word;
  n,s,i,d,t:longint;
begin
  repeat
    fillchar(len,sizeof(len),0);
    read(n,s);
    if n<s then begin writeln(1);continue;end;
      //This metamorphic case cost me 3 WAs
    len[s]:=1;
    for i:=s to n-1 do begin
      if len[i]=0 then continue;
      if i mod 100=0 then d:=1
        else if i mod 50=0 then d:=2
        else if i mod 25=0 then d:=4
        else if i mod 20=0 then d:=5
        else if i mod 10=0 then d:=10
        else if i mod 5=0 then d:=20
        else if i mod 4=0 then d:=25
        else if i mod 2=0 then d:=50
        else d:=100;
      d:=i*d div 100;
      t:=i+d;
      while t<=n do begin
        if len[i]+1>len[t] then len[t]:=len[i]+1;
        inc(t,d);
      end;
    end;

    t:=0;
    for i:=s to n do
      if len[i]>t then t:=len[i];
    writeln(t);
  until seekeof;
end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -