ural 1353. Milliard Vasya's Function
http://acm.timus.ru/problem.aspx?space=1&num=1353
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std; int dp[][];
void inti()
{
memset(dp,,sizeof(dp));
dp[][]=;
for(int i=; i<=; i++)
{
for(int j=; j<=i*; j++)
{
for(int k=; k<=; k++)
{
if(j-k>=)
dp[i][j]+=dp[i-][j-k];
}
}
}
} int main()
{
inti();
int n;
scanf("%d",&n);
if(n==)
{
printf("10\n");
return ;
}
printf("%d\n",dp[][n]);
return ;
}
ural 1353. Milliard Vasya's Function的更多相关文章
- 递推DP URAL 1353 Milliard Vasya's Function
题目传送门 /* 题意:1~1e9的数字里,各个位数数字相加和为s的个数 递推DP:dp[i][j] 表示i位数字,当前数字和为j的个数 状态转移方程:dp[i][j] += dp[i-1][j-k] ...
- ural 1353. Milliard Vasya's Function(背包/递归深搜)
1353. Milliard Vasya's Function Time limit: 1.0 second Memory limit: 64 MB Vasya is the beginning ma ...
- ural 1353. Milliard Vasya's Function(dp)
1353. Milliard Vasya's Function Time limit: 1.0 second Memory limit: 64 MB Vasya is the beginning ma ...
- URAL 1353 Milliard Vasya's Function(DP)
题目链接 题意 : 让你找出1到10^9中和为s的数有多少个. 思路 : 自己没想出来,看的题解,学长的题解报告 题解报告 //URAL 1353 #include <iostream> ...
- Ural 1353 Milliard Vasya's Function(DP)
题目地址:Ural 1353 定义dp[i][j].表示当前位数为i位时,各位数和为j的个数. 对于第i位数来说.总能够看成在前i-1位后面加上一个0~9.所以状态转移方程就非常easy出来了: dp ...
- Codeforces 837E. Vasya's Function
http://codeforces.com/problemset/problem/837/E 题意: f(a, 0) = 0; f(a, b) = 1 + f(a, b - gcd(a, b)) ...
- CodeForces - 837E - Vasya's Function | Educational Codeforces Round 26
/* CodeForces - 837E - Vasya's Function [ 数论 ] | Educational Codeforces Round 26 题意: f(a, 0) = 0; f( ...
- Milliard Vasya's Function-Ural1353动态规划
Time limit: 1.0 second Memory limit: 64 MB Vasya is the beginning mathematician. He decided to make ...
- Codeforces 837E Vasya's Function - 数论
Vasya is studying number theory. He has denoted a function f(a, b) such that: f(a, 0) = 0; f(a, b) = ...
随机推荐
- ubuntu14.04 安装tar.gz文件
UBUNTU14.04 中tar.gz安装方法 # 是root用的,如果想一直用就要先root设置密码sudo passwd root.$ 一般用户 root@big-System-Product-N ...
- android学习之4种点击事件的响应方式
如题,下面就一一列出对点击事件响应的4种方式: 第一种:内部类的形式: package com.example.dail; import android.net.Uri; import android ...
- 实用bootstrap 表格控件
http://wenzhixin.net.cn/p/bootstrap-table/docs/examples.html
- Qt Style Sheets帮助文档 Overview
Qt Style Sheets are a powerful mechanism that allows you to customize the appearance of widgets, in ...
- Android组件间的数据传输
组件我们有了,那么我们缺少一个组件之间传递信息的渠道.利用Intent做载体,这是一个王道的做法.还有呢,可以利用文件系统来做数据共享.也可以使用Application设置全局数据,利用组件来进行控制 ...
- jQuery.each() 的5个案例
1.基本的jQuery.each实例 看看 each() 函数是如何处理一个 jQuery 对象的.首先选取所有的a标签 并且打印出他们的href属性. 需要注意的是, 在 each() 当中使用 j ...
- linux elinks命令
Elinks是基于文本的免费浏览器,用于Unix及基于Unix的系统.Elinks支持 HTTP,HTTP Cookies以及支持浏览Perl和Ruby脚本.也很好的支持选项卡浏览.最棒的是它支持鼠标 ...
- 使用SQL Server CONVERT() 函数
语法 CONVERT(data_type(length),data_to_be_converted,style) data_type(length) 规定目标数据类型(带有可选的长度).data_to ...
- git变基、冲突解决
参考git rebase 版本..变基 git冲突解决先fetch,pull,如果文件冲突,手动处理冲突文件,然后再fetch,pull,发现拉不下来,这时需要将文件改为已合并,然后提交文件 具体操作 ...
- c-整型家族(integer family)
C中,整型有: characters, short integer, integer, long integer 看起来,long integer要比short integer大,但是这也是不一定的. ...