标签:style blog color io for div amp log
#include <cstdio> #include <cstring> using namespace std; int dp[50]; int main() { int n,m; while(1) { scanf("%d%d",&n,&m); if(n==0&&m==0) break; int i,j; memset(dp,0,sizeof(dp)); dp[1]=1; for(i=2;i<=n;i++) for(j=i-m;j<i;j++) if(j>0) dp[i]+=dp[j]; printf("%d\n",dp[n]); } return 0; }
hdu 1723 Distribute Message 递推,布布扣,bubuko.com
hdu 1723 Distribute Message 递推
标签:style blog color io for div amp log
原文地址:http://www.cnblogs.com/vermouth/p/3911102.html