动态规划---数位DP
文章平均质量分 90
AI蜗牛之家
北航烟酒僧~ 百度、腾讯自然语言处理算法工程师~
展开
-
HDU 3709 Balanced Number(数位DP)
A balanced number is a non-negative integer that can be balanced if a pivot is placed at some digit. More specifically, imagine each digit as a box with weight indicated by the digit. When a pivot is原创 2017-04-28 09:37:32 · 666 阅读 · 0 评论 -
动态规划汇总
博客原址: http://blog.csdn.net/cc_again?viewmode=list 动态规划一直是ACM竞赛中的重点,同时又是难点,因为该算法时间效率高,代码量少,多元性强,主要考察思维能力、建模抽象能力、灵活度。本人动态规划博客地址:http://blog.csdn.net/cc_again/article/category/1261899****原创 2017-04-19 15:46:15 · 1430 阅读 · 0 评论 -
SPOJ - BALNUM Balanced Numbers (*数位DP+三进制拆分)
Balanced numbers have been used by mathematicians for centuries. A positive integer is considered a balanced number if:1) Every even digit appears an odd number of times in its decimal represen原创 2017-04-30 19:50:19 · 1277 阅读 · 0 评论 -
HDU 4507 吉哥系列故事――恨7不成妻 (平方拆解 + *数位DP 总结)
单身! 依然单身! 吉哥依然单身! DS级码农吉哥依然单身! 所以,他生平最恨情人节,不管是214还是77,他都讨厌! 吉哥观察了214和77这两个数,发现: 2+1+4=7 7+7=7*2 77=7*11 最终,他发现原来这一切归根到底都是因为和7有关!所以,他现在甚至讨厌一切和7有关的数! 什么样的数和7有关呢? 如果一个整原创 2017-04-28 17:01:59 · 860 阅读 · 0 评论 -
第四届 山东省ACM A-Number and B-Number(数位DP+二分 待整理)
A-Number and B-NumberTime Limit: 1000MS Memory Limit: 65536KBSubmit StatisticProblem Description Tom is very interested in number problem. Nowadays he is thinking of a problem about A-num原创 2017-04-13 16:58:53 · 1123 阅读 · 0 评论 -
HDU 3652 B-number(*数位DP)
G - B-number HDU - 3652 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原创 2017-04-28 10:14:34 · 881 阅读 · 0 评论 -
ZOJ 3962 Seven Segment Display(*数位DP 总结)
Seven Segment DisplayA seven segment display, or seven segment indicator, is a form of electronic display device for displaying decimal numerals that is an alternative to the more complex dot matr原创 2017-04-23 17:09:16 · 994 阅读 · 0 评论 -
HDU 4352 XHXJ's LIS(*数位DP 记忆化搜索 待整理)
XHXJ's LIS HDU - 4352 #define xhxj (Xin Hang senior sister(学姐)) If you do not know xhxj, then carefully reading the entire description is very important. As the strongest fighting forc原创 2017-04-27 12:23:33 · 929 阅读 · 0 评论 -
CodeForces - 55D Beautiful numbers(*数位DP 取余 LCM 总结)
Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it is divisible by each of its nonzero digits. We will not argue with原创 2017-04-27 15:47:25 · 828 阅读 · 0 评论 -
HDU 2089 不要62(数位DP)
不要62 HDU - 2089 杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。 杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。 不吉利的数字为所有含有4或62的号码。例如: 62315 73418 88914 都属于不吉利号码。但是,原创 2017-04-27 19:54:36 · 714 阅读 · 0 评论 -
HDU 3555 Bomb (数位DP)
The 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 current number sequence inc原创 2017-04-27 21:30:39 · 884 阅读 · 0 评论 -
HDU 4734 F(x)(数位DP)
For a decimal number x with n digits (A nA n-1A n-2 ... A 2A 1), we define its weight as F(x) = A n * 2 n-1 + A n-1 * 2 n-2 + ... + A 2 * 2 + A 1 * 1. Now you are given two numbers A and B, please c原创 2017-04-28 11:13:03 · 762 阅读 · 0 评论 -
ZOJ 3494 BCD Code (*AC自动机+数位DP 待整理)
Binary-coded decimal (BCD) is an encoding for decimal numbers in which each digit is represented by its own binary sequence. To encode a decimal number using the common BCD encoding, each decimal digi原创 2017-04-28 11:58:32 · 844 阅读 · 0 评论 -
数位DP整理总结
数位动态规划是求解一个大区间[L, R]中间满足条件Q的所有数字的个数(或者和,或其他)的一种方法。它通过分析每一位上的数字,一般用 dp[len][digit][...] 来表示状态“len位长的数字,最高位数字为digit所具有的xx特性”,利用记忆化搜索保存中间结果,从而加快求解速度。 通过求 f(n) 从0到n中满足条件Q的数字的个数,则所求的结果为 f(R) - f(L-1).原创 2017-04-27 16:22:46 · 762 阅读 · 0 评论