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 ...
随机推荐
- StoryBoard拆分(Storyboard References)
https://www.jianshu.com/p/78dc76204c8e iOS UI篇10- Storyboard(Storyboard Reference) https://www.aliyu ...
- 【vue】vue-znly
老规矩,放下博主的项目地址:https://github.com/wohaiwo/vue-znly 我一直在想给那些开源者取什么名字比较好,怎样才对得起他们开源项目的精神,后来想想,还是叫博主吧.有的 ...
- 解释性语言和非解释性语言,GIL锁
解释性语言:python写的代码就被称为程序,cpu硬件能运行二进制代码指令.demo.py需要经过python解释器编译才做才能执行. 非解释性语言:例如c语言程序,同样需要写代码.demo.c这个 ...
- win7旗舰版64位搭建FTP服务器
1.安装IIS组件:点击开始菜单->选择控制面板->程序->打开或关闭WINDOWS功能->展开Internet信息服务,勾选FTP服务器(包括FTP服务和FTP扩展性),展开 ...
- 【html、CSS、javascript-11】jquery-事件使用方法总结
jquery提供了许多的事件处理函数,下面对其总结一下,梳理一下知识点,便于记忆和使用. 一.鼠标事件 1. click():鼠标单击事件 $div = $("div") $div ...
- Spring AOP(转)
原文:Spring实现AOP的4种方式 Spring AOP 详解 Spring实现AOP的4种方式 先了解AOP的相关术语:1.通知(Advice):通知定义了切面是什么以及何时使用.描述了切面要完 ...
- 【python自动化学习笔记】
[python自动化第一篇:python介绍与入门] [python自动化第二篇:python入门] [python自动化第三篇:python入门进阶] [Python自动化第三篇(2):文 ...
- 为GitLab配置邮件服务
修改配置文件:/etc/gitlab/gitlab.rb ####################################################################### ...
- Lua 调用C模块DLL失败
Lua中使用 local a = require "xxx" 的方式加载自己用C实现的DLL,DLL中有导出函数 luaopen_xxx . 调试过程中发现,luaopen_xxx ...
- Leetcode71. Simplify Path简化路径
给定一个文档 (Unix-style) 的完全路径,请进行路径简化. 例如, path = "/home/", => "/home" path = &qu ...