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 1024. Permutations

WA#10
Posted by Bobur 7 Feb 2008 21:44
here my code

begin
   read(n);
   for i := 1 to n do
     read(a[i]);
   max := 1;
   for i := 1 to n do
     begin
       j := 0;   x := i;
       repeat
         inc(j);
         x := a[x];
       until x = i;
       b[i] := j;
       if max <  b[i] then max := b[i];
     end;
     i := 1;
   repeat
   max := max*i;
     j := 1;  q := true;
     repeat
       if max mod b[j]=0 then inc(j)
       else q := false;
     until (j=n+1) or (q=false);
     inc(i);
   until q;
   writeLn(max);
end.

plz help, i've WA#10. thanks!
Re: WA#10
Posted by Bobur 7 Feb 2008 21:48
sorry, now i'VE WA#12!! thanks
Re: WA#10
Posted by Bobur 7 Feb 2008 23:27
now, TLE #13, i need help