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 1083. Factorials!!!

Неверный ответ на первом тесте...
Posted by RelaXes 27 May 2012 00:26
9 !! - ввод
945 - вывод
пишет wrong answer

var n,i:integer;
    res:longint;
    k:string;
begin
read(n,k);
i:=0;
res:=1;
 if n mod length(k)=0 then
 repeat
  res:=res*(n-i);
  inc(i,length(k));
 until n-i=length(k)
 else
  repeat
   res:=res*(n-i);
   inc(i,length(k));
  until n-i=1;
writeln(res);
end.
Re: Неверный ответ на первом тесте...
Posted by swaggie[Barnaul] 20 Jul 2012 16:12
как решил
Re: Неверный ответ на первом тесте...
Posted by Chornovek 16 Nov 2012 11:44
mne toje takoy:
---------------------
var
x,s:string; s1,j,i,c,l:longint;
begin
read(x);
repeat
i:=i+1;
s:=s+x[i];
until x[i]=' ';
l:=length(x)-i;
val(s,s1,c);
j:=s1;
repeat
j:=j-l;
s1:=s1*j;
until j<=1;
write(s1);
end.