ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1138. Integer Percentage

program ural1138;
  var
    i,ans,n,s:integer;
    f:array[1..10000] of integer;

procedure dp;
  var i,j:integer;
  begin
    f[s]:=1;
    for i:=s to n-1 do
     for j:=1 to 100 do
      if ((i*j) mod 100=0)and(i+(i*j) div 100<=n)
       then if f[i]+1>f[i+(i*j) div 100]
       then f[i+(i*j) div 100]:=f[i]+1
  end;

begin
  readln(n,s);
  dp;
  ans:=0;
  for i:=n downto s do if f[i]>ans then ans:=f[i];
  writeln(ans)
end.
add these:
  "if f[i]>0 then......"
Thanks.
I make a mistake here,too.
many thanks,
mistake here too