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) = ...
随机推荐
- 使用PHPExcel导出数据
最近要求做增加客流数据等导出为Excel的功能,phpExcel包功能强大,根据实际需求,我只学习了简单的功能. 安装PHPExcel 在composer.json中添加: "require ...
- 站内信DB设计实现
两年前,万仓一黍在博客园发了两篇关于站内信的设计实现博文,<群发"站内信"的实现>.<群发"站内信"的实现(续)>,其中阐述了他关于站内 ...
- swift - use backslash to add the value in the string
There’s an even simpler way to include values in strings: Write the value in parentheses, and write ...
- VS2010 使用TeeChart画图控件 - 之二 - 绘制图形(折线图,柱状图)
1.前期准备 详细可见VS2010 使用TeeChart画图控件 - 之中的一个 控件和类的导入 1. 1 加入TeeChart控件,给控件加入变量m_TeeChart 加入TeeChart控件,右击 ...
- 斐波那契数列(fabnacci)java实现
斐波那契数列定义:From Wikipedia, the free encyclopedia http://en.wikipedia.org/wiki/Fibonacci_number In math ...
- Android组件系列----BroadcastReceiver广播接收器
[声明] 欢迎转载,但请保留文章原始出处→_→ 生命壹号:http://www.cnblogs.com/smyhvae/ 文章来源:http://www.cnblogs.com/smyhvae/p/3 ...
- Android -- getSystemService
Android的后台运行在很多service,它们在系统启动时被SystemServer开启,支持系统的正常工作,比如MountService监听是否有SD卡安装及移除,ClipboardServic ...
- Java基础知识强化76:正则表达式之替换功能
1. 替换功能: String类的replaceAll方法,如下: public String replaceAll(String regex, String replacement): 使用给定的r ...
- CentOS6.3 Firefox安装FlashPlayer
这段时间搞搞CentOS,我自己用的版本是CentOS6.3,基本上都差不多,过程都一样,主要说一下步骤 1.从Adoble官网下载FlashPlayer插件,下载地址:http://get.adob ...
- android常用http框架介绍
测试数据 1.HttpURLConnection:在Android 2.2版本之前,HttpClient拥有较少的bug,因此使用它是最好的选择.而在Android 2.3版本及以后,HttpURLC ...