标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 16646 Accepted Submission(s):
6935
1 #include<stdio.h> 2 #define LL long long 3 LL f[25]; 4 void init() 5 { 6 f[0]=0; 7 f[1]=0; 8 f[2]=1; 9 for(int i=3;i<=20;i++) 10 { 11 f[i]=(i-1)*(f[i-1]+f[i-2]); 12 } 13 } 14 int main() 15 { 16 int n; 17 init(); 18 while(scanf("%d",&n)!=EOF) 19 { 20 printf("%lld\n",f[n]); 21 } 22 return 0; 23 }
标签:
原文地址:http://www.cnblogs.com/yuyixingkong/p/4584608.html