数位dp
永恒—
反复与坚持之后,柔水终成雕刀
展开
-
HDU - 4352(数位dp+状态压缩+LIS)
题意求区间范围内最长上升子序列数位k的数字有多少个解释首先由数位dp引入思路,dp转移方程为:dfs(pos,…status.) = 累加dfs(pos-1,.stautselse…)可备忘录记录的dp数组为 dp[pos][status][k] ,之所以要备忘录k,是为了满足不同k的访问status记录的是开头数字到pos位置所选择的数字组合,通过二进制压缩状态为一个数字,二进制位数...原创 2020-01-10 18:38:09 · 239 阅读 · 0 评论 -
Round Numbers POJ - 3252(数位dp)
题目The cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone’ (also known as ‘Rock, Paper, Scissors’, ‘Ro, Sham, Bo’, and a host of other names) in order to m...原创 2019-12-16 21:10:21 · 126 阅读 · 0 评论 -
Bomb HDU - 3555(基础数位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 ...原创 2019-11-24 20:32:14 · 112 阅读 · 0 评论 -
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...原创 2019-11-24 19:43:39 · 207 阅读 · 0 评论 -
吉哥系列故事――恨7不成妻 HDU - 4507(数位dp 加强)
题目单身! 依然单身! 吉哥依然单身! DS级码农吉哥依然单身! 所以,他生平最恨情人节,不管是214还是77,他都讨厌! 吉哥观察了214和77这两个数,发现: 2+1+4=7 7+7=72 77=711 最终,他发现原来这一切归根到底都是因为和7有关!所以,他现在甚至讨厌一切和7有关的数!什么样的数和7有关呢?如果一个整数符合下面3个条件之一,那...原创 2019-11-24 18:28:12 · 213 阅读 · 0 评论 -
Beautiful numbers CodeForces - 55D(数位dp)
题目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 w...原创 2019-11-22 20:05:21 · 142 阅读 · 0 评论