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 i…
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 i…
题目传送门 /* 题意:1~1e9的数字里,各个位数数字相加和为s的个数 递推DP:dp[i][j] 表示i位数字,当前数字和为j的个数 状态转移方程:dp[i][j] += dp[i-1][j-k],为了不出现负数 改为:dp[i][j+k] += dp[i-1][j] */ #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> #include <str…
题目链接 题意 : 让你找出1到10^9中和为s的数有多少个. 思路 : 自己没想出来,看的题解,学长的题解报告 题解报告 //URAL 1353 #include <iostream> #include <stdio.h> #include <string.h> using namespace std; ][] ; int main() { int s ; memset(dp,,sizeof(dp)) ; ; i < ; i++) { dp[][i] = ; d…
http://acm.timus.ru/problem.aspx?space=1&num=1353 #include <cstdio> #include <cstring> #include <algorithm> using namespace std; ][]; void inti() { memset(dp,,sizeof(dp)); dp[][]=; ; i<=; i++) { ; j<=i*; j++) { ; k<=; k++) {…
题目地址:Ural 1353 定义dp[i][j].表示当前位数为i位时,各位数和为j的个数. 对于第i位数来说.总能够看成在前i-1位后面加上一个0~9.所以状态转移方程就非常easy出来了: dp[i][j]=dp[i][j]+dp[i][j-1]+dp[i][j-2]+.......+dp[i][j-9]: 最后统计就可以. 代码例如以下: #include <iostream> #include <cstdio> #include <string> #inclu…
1.前言 2.function(下) 2.13.angular.isArray(★★) angular.isArray用于判断对象是不是数组,等价于Array.isArray console.log(angular.isArray([])); // true console.log(angular.isArray({0: '1', 1: '2', length: 2})); // false 2.14.angular.isDate(★★) 通过判断toString.call(value)是不是等…
1.前言 Angular作为最流行的前端MV*框架,在WEB开发中占据了重要的地位.接下来,我们就一步一步从官方api结合实践过程,来学习一下这个强大的框架吧. Note:每个function描述标题之后的★标明了该function的重要程度(1~5星). 2.function(上) Angular封装了一系列公共方法,帮助我们更简单的使用JS.这些就是Angular的function. 2.1.angular.bind(★) angular.bind类似于Function.prototype.…
LightOJ 1033  Generating Palindromes(dp) 题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87730#problem/A 题目: Description By definition palindrome is a string which is not changed when reversed. "MADAM" is a nice example of palindrome.…
lightOJ 1047   Neighbor House (DP) 题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87730#problem/C 题目: Description The people of Mohammadpur have decided to paint each of their houses red, green, or blue. They've also decided that no two n…