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 ...
随机推荐
- Django之数据库连接与建模
Django数据库链接(这里以Mysql为例) 需要准备 Django1.10 pip install django==1.10 -i https://pypi.tuna.tsinghua.edu.c ...
- js判断两个对象是否相等
function isObjectValueEqual(a, b) { if(typeof a == 'number' && typeof b == 'number'){ return ...
- poj2752
poj2752找所有的前缀等于后缀,那就是找所有前缀等于后缀的前缀,递归再用栈存一下 #include<iostream> #include<cstdio> #include& ...
- 2019阿里云开年Hi购季大促主会场全攻略!
2019阿里云云上采购季活动已经于2月25日正式开启,从已开放的活动页面来看,活动分为三个阶段: 2月25日-3月04日的活动报名阶段.3月04日-3月16日的新购满返+5折抢购阶段.3月16日-3月 ...
- #socket #socketserver
#通过socket 实现简单的ssh#服务端 #服务端 import os import socket server = socket.socket() #server.bind(('0.0.0.0' ...
- TZ_10_常用的2中加密算法MD5,spring-sucrity
1.MD5 在注册时需要进行加密,在登陆时也需要加密进行配对 public class MD5util { public static String stringToMD5(String psd) { ...
- PHP搜索优化 sphinx 搭建测试
安装.环境:win7 64位 1.下载sphinx文件包 下载地址:http://sphinxsearch.com/downloads/archive/ 2.解压到D:/sphinx.新建文件夹dat ...
- HDU1709
/* * 好奇怪的母函数 */ #include<cstdio> #include<cstring> #include<cmath> #include<a ...
- IDEA设置谷歌浏览器和火狐浏览器打开
我们在软件的功能栏中选择file,然后使用鼠标点击settings,进入到软件的详细设置界面 进入后,我们可以看到很多设置项,然后我们使用鼠标依次点击左侧的tools和web browsers,进 ...
- 工作记录--使用FFmpeg将一个视频文件中音频合成到另一个视频中
由于工作需要,临时被老大吩咐去研究一个FFmpeg工具,通过linux命令行去将一个视频中的音频提取出来并合成到另一个视频中,最终的效果是要保证2个视频中的音频都在一个视频中播放. 但是本人对FFmp ...