Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
why wa#include<stdio.h> __int64 TN[1001],f[100010],d[100010]; int main() { int i,j,k,m,n,s,g; int T,A,B,S; scanf("%d%d%d%d",&T,&A,&S,&B); for(i=1;i<=A;i++){scanf("%d",&k);TN[k]++;} //for(i=1;i<=T;i++) //printf("%d\n",TN[i]); for(s=0;s<=TN[1];s++) { for(g=0;g<=TN[2];g++) f[s+g]++; } TN[1]=TN[1]+TN[2]; //for(s=0;s<=TN[1];s++) //printf("%d\n",f[s]); for(i=3;i<=T;i++) { for(s=0;s<=TN[1];s++) { for(g=0;g<=TN[i];g++) d[s+g]+=f[s]; } TN[1]+=TN[i]; for(j=0;j<=TN[1];j++){f[j]=d[j];d[j]=0;} } //for(s=0;s<=TN[1];s++) //printf("%d\n",d[s]); __int64 sum=0; for(i=S;i<=B;i++) sum+=f[i]; printf("%I64d\n",sum); while(1); } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator