
数位dp
71kg
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
B-number HDU - 3652 (数位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...原创 2019-01-24 19:26:40 · 272 阅读 · 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 <=...原创 2019-01-30 20:08:22 · 214 阅读 · 0 评论 -
Balanced Numbers SPOJ - BALNUM (数位dp,状压记录状态)
Balanced numbers have been used by mathematicians for centuries. A positive integer is considered a balanced number if:1) Everyevendigit appears anoddnumber of times in its decimal represen...原创 2019-01-30 18:47:16 · 292 阅读 · 0 评论 -
吉哥系列故事——恨7不成妻 HDU - 4507 (数位dp)
单身! 依然单身! 吉哥依然单身! DS级码农吉哥依然单身! 所以,他生平最恨情人节,不管是214还是77,他都讨厌! 吉哥观察了214和77这两个数,发现: 2+1+4=7 7+7=7*2 77=7*11 最终,他发现原来这一切归根到底都是因为和7有关!所以,他现在甚至讨厌一切和7有关的数! 什么样的数和7有关呢? 如果一...原创 2019-01-30 14:56:13 · 378 阅读 · 1 评论 -
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-01-23 14:30:12 · 188 阅读 · 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-23 14:24:30 · 173 阅读 · 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-01-23 14:21:13 · 143 阅读 · 0 评论 -
不要62 HDU - 2089 数位dp模板
杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。不吉利的数字为所有含有4或62的号码。例如:62315 73418 88914都属于不吉利号码。但是,61152虽然含有6和2,但不是62连号,所以不属于不吉利数字之...原创 2019-01-23 14:17:55 · 159 阅读 · 0 评论 -
牛客寒假算法基础集训营3 处女座和小姐姐(三)(数位dp)
链接:https://ac.nowcoder.com/acm/contest/329/G来源:牛客网经过了选号和漫长的等待,处女座终于拿到了给小姐姐定制的手环,小姐姐看到以后直呼666!处女座其实也挺喜欢6这个数字的,实际上他做手环的时候选取的k=6。所以他对于包含数码6的数字极其敏感。每次看到像4567这样的数字的时候他的心就像触电了一样,想起了小姐姐。现在你要给处女座展示一系列数...原创 2019-07-21 21:36:51 · 335 阅读 · 1 评论 -
2019牛客暑期多校训练营(第七场)H Pair (数位DP)
题目链接:https://ac.nowcoder.com/acm/contest/887/H题意:给你 三个数A,B,C让你从 1~A内选择一个X,1~B内选择一个Y找出<X,Y>的对数,使得 X&Y > C || X^Y < C平常做的数位dp都是从一个区间内找数的个数,而现在是从两个区间找数对的对数,那就在之前的三维dp上多开两维,之前是枚举一...原创 2019-08-13 19:13:32 · 185 阅读 · 0 评论