-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path205.cpp
More file actions
59 lines (51 loc) · 1001 Bytes
/
Copy path205.cpp
File metadata and controls
59 lines (51 loc) · 1001 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include"bigint.h"
using namespace std;
int fact(int x)
{if(x==0||x==1) return 1;
return x*fact(x-1);
}
int main()
{int a[37],b[37];
for(int i=0;i<37;i++)
{a[i]=0;b[i]=0;}
for(int i=9;i>=0;i--)
{
for(int j=9-i;j>=0;j--)
{
for(int k=9-i-j;k>=0;k--)
{int l=9-i-j-k,m=i+2*j+3*k+4*l;
if(m>8&&m<37)
a[m]+=fact(9)/(fact(i)*fact(j)*fact(k)*fact(l));
}
}
}
for(int i=6;i>=0;i--)
{
for(int j=6-i;j>=0;j--)
{
for(int k=6-i-j;k>=0;k--)
{
for(int l=6-i-j-k;l>=0;l--)
{
for(int m=6-i-j-k-l;m>=0;m--)
{
int n=6-i-j-k-l-m,o=i+2*j+3*k+4*l+5*m+6*n;
if(o>5&&o<37)
b[o]+=fact(6)/(fact(i)*fact(j)*fact(k)*fact(l)*fact(m)*fact(n));
}
}
}
}
}
BigInt num;
for(int i=9;i<37;i++)
{
for(int j=i-1;j>5;j--)
{num+=(BigInt(a[i])*BigInt(b[j]));
}
}
cout<<num;
//divide by 4^9*6^6 to get answer
system("pause");
return 0;
}