$dp$。

记$dp[i][j]$表示已经放了$i$个数字,并且第$i$个数字放了$j$的方案数。那么$dp[i][j] = \sum\limits_{k|j}^{}  {dp[i - 1][k]}$。答案为$\sum\limits_{k=1}^{m}  {dp[n][k]}$

#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<iostream>
using namespace std;
typedef long long LL;
const double pi=acos(-1.0),eps=1e-;
void File()
{
freopen("D:\\in.txt","r",stdin);
freopen("D:\\out.txt","w",stdout);
}
template <class T>
inline void read(T &x)
{
char c = getchar();
x = ;
while(!isdigit(c)) c = getchar();
while(isdigit(c)) { x = x * + c - ''; c = getchar(); }
} const int maxn=;
LL dp[maxn][maxn],mod=1e9+;
int n,m; int main()
{
scanf("%d%d",&m,&n);
for(int i=;i<=m;i++) dp[][i]=;
for(int i=;i<=n;i++)
{
for(int j=;j<=m;j++)
{
for(int k=j;k<=m;k=k+j)
{
dp[i+][k]=(dp[i+][k]+dp[i][j])%mod;
}
}
}
LL ans=;
for(int i=;i<=m;i++) ans=(ans+dp[n][i])%mod;
cout<<ans<<endl;
return ;
}

CodeForces 415D Mashmokh and ACM的更多相关文章

  1. Codeforces 414B Mashmokh and ACM

    http://codeforces.com/problemset/problem/414/B 题目大意: 题意:一个序列B1,B2...Bl如果是好的,必须满足Bi | Bi + 1(a | b 代表 ...

  2. codeforces D.Mashmokh and ACM

    题意:给你n和k,然后找出b1, b2, ..., bl(1 ≤ b1 ≤ b2 ≤ ... ≤ bl ≤ n),并且对所有的bi+1%bi==0,问有多少这样的序列? 思路:dp[i][j] 表示长 ...

  3. 【codeforces 415D】Mashmokh and ACM(普通dp)

    [codeforces 415D]Mashmokh and ACM 题意:美丽数列定义:对于数列中的每一个i都满足:arr[i+1]%arr[i]==0 输入n,k(1<=n,k<=200 ...

  4. codeforces 414B B. Mashmokh and ACM(dp)

    题目链接: B. Mashmokh and ACM time limit per test 1 second memory limit per test 256 megabytes input sta ...

  5. Codeforces Round #240 (Div. 1) B. Mashmokh and ACM DP

                                                 B. Mashmokh and ACM                                     ...

  6. B. Mashmokh and ACM(dp)

    http://codeforces.com/problemset/problem/414/B B. Mashmokh and ACM time limit per test 1 second memo ...

  7. codeforces 414D Mashmokh and Water Tanks

    codeforces 414D Mashmokh and Water Tanks 题意 题解 \(a_i\):第 \(i\) 层的结点个数. \(b_i\):第 \(i\) 层初始有水的结点个数. 如 ...

  8. Mashmokh and ACM CodeForces - 414D (贪心)

    大意: 给定n结点树, 有k桶水, p块钱, 初始可以任选不超过k个点(不能选根结点), 在每个点放一桶水, 然后开始游戏. 游戏每一轮开始时, 可以任选若干个节点关闭, 花费为关闭结点储存水的数量和 ...

  9. Codeforces Round #445 A. ACM ICPC【暴力】

    A. ACM ICPC time limit per test 2 seconds memory limit per test 256 megabytes input standard input o ...

随机推荐

  1. 读书笔记—CLR via C#异常和状态管理

    前言 这本书这几年零零散散读过两三遍了,作为经典书籍,应该重复读反复读,既然我现在开始写博了,我也准备把以前觉得经典的好书重读细读一遍,并且将笔记整理到博客中,好记性不如烂笔头,同时也在写的过程中也可 ...

  2. Image 对象

    <html> <body> <img id="compman" src="0387.jpg" alt="Computer ...

  3. NhibernateProfiler-写个自动破解工具(源码)

    04 2013 档案   [屌丝的逆袭系列]是个人都能破解之终结NhibernateProfiler-写个自动破解工具(源码) 摘要: 破解思路分析及手动破解 增加“附加到进程”功能--功能介绍增加“ ...

  4. cygwin的安装使用

    Cygwin 是一个用于 Windows 的类 UNIX shell 环境. 它由两个组件组成:一个 UNIX API 库,它模拟 UNIX 操作系统提供的许多特性:以及 Bash shell 的改写 ...

  5. 初识Identity

    初识Identity 摘要 通过本文你将了解ASP.NET身份验证机制,表单认证的基本流程,ASP.NET Membership的一些弊端以及ASP.NET Identity的主要优势. 目录 身份验 ...

  6. C#事件与委托的区别

    C#事件与委托的区别 1. 委托 事件是利用委托来定义的,因此先解释委托.委托是一个类,它与其他类如int,string等没有本质区别,int代表的是所有的整形,而string代表的是字符串,委托则代 ...

  7. 线程池python

    原创博文,转载请注明出处 今天在学习python进程与线程时,无意间发现了线程池threadpool模块,见官方文档. 模块使用非常简单,前提是得需要熟悉线程池的工作原理. 我们知道系统处理任务时,需 ...

  8. 用Python复习离散数学(二)

    这次复习的是计数问题,立刻走起吧! 1.乘法原理 如果一项工作需要t步完成的,第一步有n1种不同的选择,第二步有n2种不同的选择,……,第t步有nt中不同的选择,那么完成这项工作所有可能的选择种数为: ...

  9. Solrcloud,tomcat,外部zookeeper配置

  10. [Usaco2008 Dec]Patting Heads 轻拍牛头[筛法]

    Description   今天是贝茜的生日,为了庆祝自己的生日,贝茜邀你来玩一个游戏.     贝茜让N(1≤N≤100000)头奶牛坐成一个圈.除了1号与N号奶牛外,i号奶牛与i-l号和i+l号奶 ...