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) = ...
随机推荐
- <a>标签的href属性
<a> 标签的 href 属性用于指定超链接目标的 URL. 语法 <a href="value"> 属性值 值 描述 URL 超链接的 URL.可能的值: ...
- atol字符串转换函数应用实例
原型:long atol(const char *nptr); 相关函数 atoi,atol,strtod,strtol,strtoul 头文件:stdlib.h 功能:将字符串转换成整型数 说明:参 ...
- [Unit Testing] Angular Test component with required
export default (ngModule) => { describe('Table Item component', () => { let $compile, directiv ...
- Embedded tomcat 7 servlet 3.0 annotations not working--转
Question: I have a stripped down test project which contains a Servlet version 3.0, declared with an ...
- 使用MySQL的LAST_INSERT_ID--转
LAST_INSERT_ID 自动返回最后一个 INSERT 或 UPDATE 操作为 AUTO_INCREMENT 列设置的第一个发生的值. 参考这里 The ID that was generat ...
- 海尔的U+智慧生活操作系统
通过一个手机APP就能操控家庭内的不同品牌的家电家居设备.在连接Wifi的状态下,海尔智能路由器能够自动连接上家庭里的智能冰箱.智能洗衣机.智能空调.智能烤箱.空气盒子等设备端.在智能手机上下载海尔U ...
- java相关的路径获取 (转载 http://tomfish88.iteye.com/blog/971255)
在jsp和class文件中调用的相对路径不同.在jsp里,根目录是WebRoot 在class文件中,根目录是WebRoot/WEB-INF/classes 当然你也可以用System.getProp ...
- [Android]android.graphics.Camera实现图像的旋转、缩放,配合Matrix实现图像的倾斜
android.graphics.Camera可以对图像执行一些比较复杂的操作,诸如旋转与绽放,与Matrix可实现图像的倾斜. 个人总结Camera与Matrix的一些区别如下: Camera的ro ...
- DBMS_STATS常用方法(收集oracle信息)
–收集数据库信息EXEC DBMS_STATS.gather_database_stats;EXEC DBMS_STATS.gather_database_stats(estimate_percent ...
- adb服务启动失败处理命令
执行以下命令: D:\android-sdks\platform-tools>adb kill-server --停止adb服务 D:\android-sdks\platform-tools&g ...