|
|
back to boardhelp!what's wrong with my code?I always get WA 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. |
|
|