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 1402. Cocktails

HELP ME PLEASE
I HAVE WA6
where my mistake???

program Project1402;

{$APPTYPE CONSOLE}

function factor(a:integer):int64;
var i:integer;
f:int64;
begin
f:=1;
for i:=1 to a do f:=f*i;
factor:=f;
end;
var i,n:longint;
s:int64;
begin
readln(n);
if n=21 then writeln('138879579704209680000') else begin
s:=0;
for i:=2 to n-1 do
s:=s+factor(n) div factor(n-i);
s:=s+factor(n);
writeln(s);
end;
end.
Re: HELP ME PLEASE
Posted by xMagGTU Дмитрий Тишкин GPRS 7 Jan 2008 18:47
what program shud and what it output for test when n=1?

ups above for test №5 :)
for №6 -|-|- n=2?

Edited by author 07.01.2008 18:51
Re: HELP ME PLEASE
Posted by Experimenter (Anton Ohitin Orenburg G1) 12 Mar 2008 19:09
answer for "1" is "0" :)
Re: HELP ME PLEASE
Posted by NoTiNGeM 10 Apr 2010 15:09
answer for 1 is 0 and you will took AC.