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

help!what's wrong with my code?I always get WA
Posted by Destiny 6 Nov 2002 12:36
program integerp;
var
 n,s:longint;
 p:array[1..10000]of longint;
procedure init;
begin
 readln(n,s);
 if n<s then
  begin
   writeln('0');
   halt;
  end;
end;
procedure solve;
var
 i,j,max:longint;
begin
 fillchar(p,sizeof(p),0);
 p[s]:=1;
 for i:=s+1 to n do
  for j:=i-1 downto s do
   if (i*100 mod j=0) then
    if p[j]+1>p[i] then
      p[i]:=p[j]+1;
 max:=p[s];
 for i:=s+1 to n do
  if p[i]>max then
    max:=p[i];
 writeln(max);
end;
begin
 init;
 solve;
end.