
数位DP
隔阂0323
加速零到一百公里
展开
-
不要62 HDU - 2089 数位DP
杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。不吉利的数字为所有含有4或62的号码。例如:62315 73418 88914都属于不吉利号码。但是,61152虽然含有6和2,但不是62连号,所以不属于不吉利数字之列。你...原创 2019-02-03 16:20:23 · 312 阅读 · 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 inc...原创 2019-02-03 18:29:44 · 133 阅读 · 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 make...原创 2019-01-25 23:31:05 · 115 阅读 · 0 评论 -
Balanced Number HDU - 3709 数位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 ...原创 2019-02-03 20:02:34 · 175 阅读 · 0 评论 -
HDU - 4734 数位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 calcula...原创 2019-02-03 21:13:21 · 129 阅读 · 0 评论 -
吉哥系列故事——恨7不成妻 HDU - 4507
单身! 依然单身! 吉哥依然单身! DS级码农吉哥依然单身! 所以,他生平最恨情人节,不管是214还是77,他都讨厌! 吉哥观察了214和77这两个数,发现: 2+1+4=7 7+7=72 77=711 最终,他发现原来这一切归根到底都是因为和7有关!所以,他现在甚至讨厌一切和7有关的数!什么样的数和7有关呢?如果一个整数符合下面3个条件之一,那么我们...原创 2019-02-03 22:19:27 · 704 阅读 · 0 评论 -
Balanced Numbers SPOJ - BALNUM 数位DP+三进制状态压缩
Balanced numbers have been used by mathematicians for centuries. A positive integer is considered a balanced number if: Every even digit appears an odd number of times in its decimal representation...原创 2019-02-03 22:43:24 · 161 阅读 · 0 评论 -
X mod f(x) HDU - 4389 数位DP
Here is a function f(x): int f ( int x ) { if ( x == 0 ) return 0; return f ( x / 10 ) + x % 10; }Now, you want to know, in a given interval [A, B] (1 <= A <= B <= 10 9),...原创 2019-02-03 22:55:04 · 187 阅读 · 0 评论