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 1157. Young Tiler

why my program got WA?Please help me!
Posted by NeverGiveUp 3 Sep 2002 15:27
var
 a:array[1..10000]of integer;
 m,n,k,i,j:integer;

begin
 fillchar(a,sizeof(a),0);
 readln(m,n,k);
 for i:=k+1 to 10000 do
  begin
   for j:=1 to trunc(sqrt(i)) do
    if i mod j=0 then a[i]:=a[i]+1;
   if (a[i]=n)and(a[i-k]=m) then begin writeln(i);halt;end;
  end;
end.
Re: why my program got WA?Please help me!
Posted by Martin Ivanov 3 Apr 2009 17:00
because your algorithm is wrong