HDU2200
水题~~~
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 /* 2 C(N,M) 3 */ 4 #include<stdio.h> 5 #include<string.h> 6 #include<stdlib.h> 7 #include<algorithm> 8 #include<iostream> 9 #include<queue> 10 #include<stack> 11 #include<math.h> 12 #include<map> 13 typedef __int64 int64; 14 using namespace std; 15 const int maxn = 1005; 16 int64 solve( int64 n,int64 m ){ 17 int64 sum=1; 18 int64 tt=1; 19 for( int64 i=n;i>=n-m+1;i-- ){ 20 sum=sum*i/tt; 21 tt++; 22 } 23 return sum; 24 } 25 int main(){ 26 int64 n; 27 while( scanf("%I64d",&n)!=EOF ){ 28 int64 sum=0; 29 for( int64 i=2;i<=n;i++ ){ 30 sum+=( solve( n,i )*( i-1 ) ); 31 } 32 printf("%I64d\n",sum); 33 } 34 return 0; 35 }
keep moving...