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

Why do I get WA???
Posted by ChuanLin 3 Sep 2002 15:33
var
 ok:array[1..10000]of longint;
 n,s,i,j,min:longint;
 nf,sf,max:longint;
begin
 fillchar(ok,sizeof(ok),0);
 readln(n,s);
 ok[s]:=1;max:=0;
 for i:=s to n-1 do
 begin
  if i*2>=n then min:=n else min:=i*2;
  for j:=i+1 to min do
   if (ok[i]+1>ok[j])and(j*100 mod i=0) then
    ok[j]:=ok[i]+1;
  if max<ok[i] then max:=ok[i];
 end;
 writeln(max);
end.