1353. Milliard Vasya's Function

Time limit: 1.0 second Memory limit: 64 MB
Vasya is the beginning mathematician. He decided to make an important contribution to the science and to become famous all over the world. But how can he do that if the most interesting facts such as Pythagor’s theorem are already proved? Correct! He is to think out something his own, original. So he thought out the Theory of Vasya’s Functions. Vasya’s Functions (VF) are rather simple: the value of the Nth VF in the point S is an amount of integers from 1 to N that have the sum of digitsS. You seem to be great programmers, so Vasya gave you a task to find the milliard VF value (i.e. the VF with N = 109) because Vasya himself won’t cope with the task. Can you solve the problem?

Input

Integer S (1 ≤ S ≤ 81).

Output

The milliard VF value in the point S.

Sample

input output
  1. 1
  1. 10

ural 1353. Milliard Vasya's Function(dp)的更多相关文章

  1. 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 ...

  2. 递推DP URAL 1353 Milliard Vasya's Function

    题目传送门 /* 题意:1~1e9的数字里,各个位数数字相加和为s的个数 递推DP:dp[i][j] 表示i位数字,当前数字和为j的个数 状态转移方程:dp[i][j] += dp[i-1][j-k] ...

  3. URAL 1353 Milliard Vasya's Function(DP)

    题目链接 题意 : 让你找出1到10^9中和为s的数有多少个. 思路 : 自己没想出来,看的题解,学长的题解报告 题解报告 //URAL 1353 #include <iostream> ...

  4. ural 1353. Milliard Vasya's Function

    http://acm.timus.ru/problem.aspx?space=1&num=1353 #include <cstdio> #include <cstring&g ...

  5. Ural 1353 Milliard Vasya&#39;s Function(DP)

    题目地址:Ural 1353 定义dp[i][j].表示当前位数为i位时,各位数和为j的个数. 对于第i位数来说.总能够看成在前i-1位后面加上一个0~9.所以状态转移方程就非常easy出来了: dp ...

  6. Angular从0到1:function(下)

    1.前言 2.function(下) 2.13.angular.isArray(★★) angular.isArray用于判断对象是不是数组,等价于Array.isArray console.log( ...

  7. Angular从0到1:function(上)

    1.前言 Angular作为最流行的前端MV*框架,在WEB开发中占据了重要的地位.接下来,我们就一步一步从官方api结合实践过程,来学习一下这个强大的框架吧. Note:每个function描述标题 ...

  8. LightOJ 1033 Generating Palindromes(dp)

    LightOJ 1033  Generating Palindromes(dp) 题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid= ...

  9. lightOJ 1047 Neighbor House (DP)

    lightOJ 1047   Neighbor House (DP) 题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87730# ...

随机推荐

  1. CSU 1811 Tree Intersection

    莫队算法,$dfs$序. 题目要求计算将每一条边删除之后分成的两棵树的颜色的交集中元素个数. 例如删除$u->v$,我们只需知道以$v$为$root$的子树中有多少种不同的颜色(记为$qq$), ...

  2. 学习笔记_ADB常用指令

    ADB 查看连接到计算机的Android设备或模拟器 adb devices 说明: 正常显示状态应该是IP:Port State. State=device说明设备已经连接到计算机, State=o ...

  3. js的特殊运算符

    1)三元条件运算符: c是一个布尔值,当c为true的时候,取冒号左边a的值,否取冒号右边的b的值: 2)逗号运算符: 值从左到右依次计算,取最右边的,例如例子里的val,会取最右边的值3: 特殊运算 ...

  4. django模板 实现奇偶分行

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  5. mac xcode 快捷键

    shift + cmd + n     新建项目 cmd + n             新建文件 视图 option + cmd + 回车 打开助理编辑器 cmd + 回车           显示 ...

  6. sql第一天

    关系数据库中的关系指的就是表 table 表   Column 列   Field 字段   Row 行 非空约束  not null 主键约束(PK)primary key constraint 唯 ...

  7. Atomic 升级

    Atomic 采用类似github的版本管理,  可以使用以下命令升级 ostree remote add --set=gpg-verify=false atomic20160212 http://. ...

  8. qemu毒液漏洞分析(2015.9)

    0x00背景 安全娱乐圈媒体Freebuf对该漏洞的有关报道: 提供的POC没有触发崩溃,在MJ0011的博客给出了修改后可以使qemu崩溃的poc.详见: http://blogs.360.cn/b ...

  9. Python 修炼3

    # 列表 功能方法 *补充(zip zip(list1,list2) 会形成一个[(),()]新的列表list1和list2一一对应得组成一个新的元素以元组最为单位) # 1.修改# li = [1, ...

  10. rsync 断点续传

    # rsync -avzP file root@172.20.7.219:/root/tmp           (我这里file指要传送的文件)