标签:style blog color os io for div amp
无脑搜,加个记忆化。当时只过了这题和A题
#include <cstdio> #include <cstring> #include <cmath> #include <algorithm> #include <climits> #include <string> #include <iostream> #include <map> #include <cstdlib> #include <list> #include <set> #include <queue> #include <stack> using namespace std; int n,k; int dp[2222][2222]; const int mod= 1e9+7; int dfs(int x,int pre) { if(~dp[x][pre]) return dp[x][pre]; if(x==k) return dp[x][pre]=1; int ret=0; for(int i= 1;i*pre<=n;i++) ret+=dfs(x+1,i*pre),ret%=mod; return dp[x][pre]=ret; } int main() { scanf("%d%d",&n,&k); memset(dp,-1,sizeof(dp)); cout<<dfs(0,1)<<endl; return 0; }
CF414BMashmokh and ACMDP,布布扣,bubuko.com
标签:style blog color os io for div amp
原文地址:http://www.cnblogs.com/yigexigua/p/3907171.html