ACM__数位DP
文章平均质量分 81
wust_zwl
学不死,就往死里学。
展开
-
codeforces 55D Beautiful numbers(数位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 with this and just count the quantity of beautiful numbers i原创 2017-08-23 14:49:38 · 299 阅读 · 0 评论 -
POJ 3252 Round Numbers (数位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 arbitrary decisions such as who gets to be milked first原创 2017-08-28 10:40:34 · 284 阅读 · 0 评论 -
HDU 2089 不要62 (数位dp)
杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。 杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。 不吉利的数字为所有含有4或62的号码。例如: 62315 73418 88914 都属于不吉利号码。但是,61152虽然含有6和2,但不是62连号,所以不属于不吉利数字之列。 你的任务是,对于每次给出的一个牌照区间号,推断出交管局今次又要实际上给多少辆新的士车上牌照了。原创 2017-08-24 09:39:54 · 243 阅读 · 0 评论 -
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 placed at some digit of the number, the distance from a原创 2017-08-28 15:40:54 · 378 阅读 · 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 are not. Your task is to calculate how many wqb-numbers fr原创 2017-08-28 19:34:51 · 329 阅读 · 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 calculate how many numbers are there between 0 and B, inclu原创 2017-08-29 09:41:21 · 652 阅读 · 0 评论 -
HDU 4507 吉哥系列故事――恨7不成妻 (高级数位DP)【模板】
单身! 依然单身! 吉哥依然单身! DS级码农吉哥依然单身! 所以,他生平最恨情人节,不管是214还是77,他都讨厌! 吉哥观察了214和77这两个数,发现: 2+1+4=7 7+7=7*2 77=7*11 最终,他发现原来这一切归根到底都是因为和7有关!所以,他现在甚至讨厌一切和7有关的数!原创 2017-09-02 21:04:22 · 449 阅读 · 0 评论 -
SPOJ Balanced Numbers (数位DP+3进制状压)【模板】
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 representation2) Every odd digit appears an even number o原创 2017-09-03 11:06:03 · 506 阅读 · 0 评论 -
CodeForces - 258B King's Path(数位dp)
There have recently been elections in the zoo. Overall there were 7 main political parties: one of them is the Little Elephant Political Party, 6 other parties have less catchy names.Political parties find their number in the ballot highly important. Ove原创 2017-10-15 23:00:43 · 308 阅读 · 0 评论