ENG  RUS Timus Online Judge
Online Judge
Problems
Authors
Online contests
Site news
Webboard
Problem set
Submit solution
Judge status
Guide
Register
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1402. Cocktails

WA#13
Posted by kxurshid 19 Sep 2009 01:43
My code:

#include <iostream>
using namespace std;

double fac(int n)
{
double l = 1.0;
for(int i = 1; i <= n; i++)
l *=i;
return l;
}
double A(int m, int n)
{
return fac(m)/fac(m-n);
}

void main()
{
int n;
double soni = 0;
cin >> n;

for(int i = 2; i<=n; i++)
{
soni += A(n,i);
}

cout.precision(0);
cout << fixed << soni;
}

WA#13
Where is my mistake? pls help me
Re: WA#13
Posted by hanchengdong 25 Sep 2009 17:08
i have met the same problem with u
Re: WA#13
Posted by Dawei Huang 28 Jan 2012 00:07
Precision

Edited by author 28.01.2012 00:07

Edited by author 28.01.2012 00:07
Re: WA#13
Posted by Andrew Sboev 30 Mar 2012 13:05
Use C# & BigInteger & permutaions
http://ru.wikipedia.org/wiki/Размещение
Re: WA#13
Posted by TUITUF_Bahrom 5 Apr 2013 13:57
primer
21=138879579704209680000
19=330665665962403980
20=6613313319248079980
Re: WA#13
Posted by Paata Julakidze 22 Jun 2013 17:14
0-1
2-2
3-12
4-60
5-320
6-1950
7-13692
8-109592
9-986400
10-9864090
11-108505100
12-1302061332
13-16926797472
14-236975164790
15-3554627472060
16-56874039553200
17-966858672404672
18-17403456103284402
19-330665665962403980
20-6613313319248079980
21-138879579704209680000