HDU 2049 不容易系列之(4)——考新郎
#include<stdio.h> long long num[25],N[25]; int main( ) { num[1] = 0; num[2] = 1; N[1] = 1; N[2] = 2; N[0] = 1; for( int i = 3; i < 25; ++i ) num[i] = ( num[i-1] + num[i-2] )*( i - 1 ),N[i] = i * N[i-1]; int t,n,m; scanf( "%d",&t ); while( t-- ) { scanf( "%d%d",&n,&m ); printf( "%I64d\n",N[n] / N[n-m] / N[m] *num[m] ); } return 0; }
本人还是新手 ,转载请注明来自Lvsi‘s home