数位DP
文章平均质量分 77
h1021456873
这个作者很懒,什么都没留下…
展开
-
HDU 3555 Bomb (数位DP)
Problem DescriptionThe counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence of the time bomb counts from 1 to N. If the curr原创 2016-03-22 13:04:31 · 381 阅读 · 1 评论 -
UESTC 250 windy数 (数位DP)
windy定义了一种windy数。不含前导零且相邻两个数字之差至少为22的正整数被称为windy数。windy想知道,在AA和BB之间,包括AA和BB,总共有多少个windy数?Input包含两个整数,AA BB。满足 1≤A≤B≤20000000001≤A≤B≤2000000000 .OutputSample input and o原创 2016-03-24 01:15:02 · 395 阅读 · 0 评论 -
数位DP学习 (总结篇)
http://www.cnblogs.com/jackge/archive/2013/05/15/3080958.html1, HDU 2089 不要62 :http://acm.hdu.edu.cn/showproblem.php?pid=2089题意:不能出现4,或者相邻的62, dp[i][0],表示不存在不吉利数字 dp[i][1]原创 2016-03-24 01:18:20 · 1501 阅读 · 1 评论 -
uva 1640 The Counting Problem (数位dp||统计0-9的个数)
Given two integersaandb, we write the numbers betweenaandb, inclusive, in a list. Your task is tocalculate the number of occurrences of each digit. For example, if原创 2017-01-15 13:37:33 · 405 阅读 · 0 评论 -
数位DP模板
// pos = 当前处理的位置(一般从高位到低位)// pre = 上一个位的数字(更高的那一位)// status = 要达到的状态,如果为1则可以认为找到了答案,到时候用来返回,// 给计数器+1。// limit = 是否受限,也即当前处理这位能否随便取值。如567,当前处理6这位,// 如果前面取原创 2017-03-03 11:46:23 · 218 阅读 · 0 评论 -
FZU 2109 Mountain Number (数位DP)
One integer number x is called "Mountain Number" if:(1) x>0 and x is an integer;(2) Assume x=a[0]a[1]...a[len-2]a[len-1](0≤a[i]≤9, a[0] is positive). Any a[2i+1] is larger or equal to a[2i] and a[原创 2017-03-03 12:03:58 · 270 阅读 · 0 评论 -
HDU - 3652 B-number (数位DP)
A wqb-number, or B-number for short, is a non-negative integer whose decimal form contains the sub- string "13" and can be divided by 13. For example, 130 and 2613 are wqb-numbers, but 143 and 2639 ar原创 2017-03-04 20:17:26 · 165 阅读 · 0 评论 -
HDU - 4507 吉哥系列故事――恨7不成妻 (数位DP,推公式啊)
单身! 依然单身! 吉哥依然单身! DS级码农吉哥依然单身! 所以,他生平最恨情人节,不管是214还是77,他都讨厌! 吉哥观察了214和77这两个数,发现: 2+1+4=7 7+7=7*2 77=7*11 最终,他发现原来这一切归根到底都是因为和7有关!所以,他现在甚至讨厌一切和7有关的数! 什么样的数原创 2017-03-05 19:59:18 · 455 阅读 · 0 评论