标签:des style blog http io ar color os sp
2 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 2 6 2 10 2 2 5 6 1 0 2 7 0 2 2 7 5 10 6 10 2 10 6 1 9
7 379297
#include<stdio.h> #include<string.h> int a[10000],s[10000]; int main() { int b[27],c[27]; int i,j,k,test,sum; scanf("%d",&test); while(test--) { for(i=1;i<=26;i++) { scanf("%d",&b[i]); c[i]=i; } memset(a,0,sizeof(a)); memset(s,0,sizeof(s)); for(i=0;i<=b[1]&&i<=50;i++) { s[i]=1; } for(i=2;i<=26;i++) { for(j=0;j<=50;j++) { for(k=0;(k+j)<=50&&k<=b[i]*c[i];k+=i) { a[k+j]+=s[j]; } } for(j=0;j<=50;j++) { s[j]=a[j]; a[j]=0; } } for(i=1,sum=0;i<=50;i++) { sum+=s[i]; } printf("%d\n",sum); } return 0; }
标签:des style blog http io ar color os sp
原文地址:http://blog.csdn.net/hdd871532887/article/details/41296947