Codeforces 414B
附上代码:
#include<cstdio>
#include<cstring>
#include<bits/stdc++.h> #define mod 1000000007
int n, k;
// dp[len][last]
int dp[][]; int
main(void) {
while(~scanf("%d %d",&n,&k)){
memset(dp,,sizeof(dp));
for(int i =; i <= n; i++)
dp[][i]=;
for(int i =; i <= k; i++) {
for(int j =; j <= n; j++) {
for(int t = j; t <= n; t += j){
dp[i][t]+= dp[i-][j];
dp[i][t]%= mod;
}
}
}
int ans =;
for(int i =; i <= n; i++)
ans =(ans + dp[k][i])% mod;
27 printf("%d\n", ans);
}
return0;
}
Codeforces 414B的更多相关文章
- Codeforces 414B Mashmokh and ACM
http://codeforces.com/problemset/problem/414/B 题目大意: 题意:一个序列B1,B2...Bl如果是好的,必须满足Bi | Bi + 1(a | b 代表 ...
- 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 ...
- python爬虫学习(5) —— 扒一下codeforces题面
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...
- 【Codeforces 738D】Sea Battle(贪心)
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...
- 【Codeforces 738C】Road to Cinema
http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants ...
- 【Codeforces 738A】Interview with Oleg
http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interv ...
- CodeForces - 662A Gambling Nim
http://codeforces.com/problemset/problem/662/A 题目大意: 给定n(n <= 500000)张卡片,每张卡片的两个面都写有数字,每个面都有0.5的概 ...
- CodeForces - 274B Zero Tree
http://codeforces.com/problemset/problem/274/B 题目大意: 给定你一颗树,每个点上有权值. 现在你每次取出这颗树的一颗子树(即点集和边集均是原图的子集的连 ...
- CodeForces - 261B Maxim and Restaurant
http://codeforces.com/problemset/problem/261/B 题目大意:给定n个数a1-an(n<=50,ai<=50),随机打乱后,记Si=a1+a2+a ...
随机推荐
- N!中素因子p的个数 【数论】
求N!中素因子p的个数,也就是N!中p的幂次 公式为:cnt=[n/p]+[n/p^2]+[n/p^3]+...+[n/p^k]; 例如:N=12,p=2 12/2=6,表示1~12中有6个数是2的倍 ...
- Django-rest Framework(三)
今天看了drf的五个组件的源码,可读性还是很高的,只是读组件的时候要注意的是 大部分的组件都是由dispatch分发出去的,所以看源码的时候一定要抓住dispatch这条主线,一步一步看下去 一. d ...
- hdu3853之概率dp入门
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/xingyeyongheng/article/details/25205693 LOOPS Time ...
- JavaScript内容梳理 示例之模态对话框 示例之全选和反选以及取消 示例之后台管理左侧菜单
<!DOCTYPE html> <!--示例之模态对话框--> <html lang="en"> <head> <meta c ...
- R330 打印机连供墨水红灯常量处理
墨水灯红灯常量,表示墨盒没墨水 1.按红灯,将墨盒移动到右侧空处 2.按住连供顶部的重置小按钮 15秒以上,复位(这个应该是让连供墨盒产生一个另外的墨盒序号,骗打印机换了个新墨盒) 3.按打印机红灯, ...
- Java Servlet实现下载文件
一.配置servlet 在WebContent(以前的eclipse版本是WebRoot)文件夹下,有一个web.xml 修改web.xml ,加入以下代码 <servlet> <s ...
- GIT → 09:TortoiseGit 图形化工具
GIT → 09:TortoiseGit 图形化工具
- day36 04-Hibernate检索方式:多表连接查询
返回的是一个List集合,这个List集合的泛型是一个Object数组.最后会拿到一个里面放Object数组的List集合. HQL内连接查询,发出SQL语句查询出来的结果集被Hibernate封装成 ...
- 2018-8-10-如何移动-nuget-缓存文件夹
title author date CreateTime categories 如何移动 nuget 缓存文件夹 lindexi 2018-08-10 19:16:51 +0800 2018-2-13 ...
- Django用户登陆以及跳转后台管理页面1
"""S14Djngo URL Configuration The `urlpatterns` list routes URLs to views. For more i ...