数位dp
文章平均质量分 76
闻道-问道
这个作者很懒,什么都没留下…
展开
-
日记(周中)
这几周要从数论和dp中选择一个学习,由于队友选择了数论,我就选择了dp,刚开始要学习数位dp。 通过看了很多博客,知道了数位dp就是计数用的,最基础题型是计算一个区间(a,b)符合某个条件的数的个数。一般这种题就是枚举做,而数位dp就是一种暴力枚举的方法。它就是在数位上一位一位的枚举,使得这种枚举方式符合dp的定义,并且使用记忆化搜索,就会节省枚举的时间。 一般这种题都有模板。原创 2017-10-19 22:15:47 · 183 阅读 · 0 评论 -
K-th Nya Number (数位dp+二分)
Arcueid likes nya number very much. A nya number is the number which has exactly X fours and Y sevens(If X=2 and Y=3 , 172441277 and 47770142 are nya numbers.But 14777 is not a nya number ,because i原创 2017-11-10 23:06:19 · 251 阅读 · 0 评论 -
Mirror Number (数位dp)
A number is called a Mirror number if on lateral inversion, it gives the same number i.e it looks the same in a mirror. For example 101 is a mirror number while 100 is not. Given two numbers a and b原创 2017-11-12 23:21:26 · 299 阅读 · 0 评论 -
Horse Races (数位dp)
Petya likes horse racing very much. Horses numbered from l to r take part in the races. Petya wants to evaluate the probability of victory; for some reason, to do that he needs to know the amount of原创 2017-11-12 23:41:02 · 586 阅读 · 0 评论 -
How Many Zeroes? (数位dp)
Jimmy writes down the decimal representations of all natural numbers between and includingm and n, (m ≤ n). How many zeroes will he write down?InputInput starts with an integer T (≤ 11000), deno原创 2017-11-03 23:22:21 · 282 阅读 · 0 评论 -
odd-even number (数位dp)
For a number,if the length of continuous odd digits is even and the length of continuous even digits is odd,we call it odd-even number.Now we want to know the amount of odd-even number between L,R(1<=原创 2017-11-03 23:33:14 · 1021 阅读 · 0 评论 -
Seven Segment Display(数位dp)
A 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 matrix displays. Seven segmen...原创 2018-03-31 21:15:56 · 1227 阅读 · 0 评论 -
#1791 : 幸运数字(数位dp)
描述定义一个数字 x 是幸运的,当且仅当 x 是 x 十进制下所有数位的和的倍数例如 1..9 所有数都是幸运数,120 也是幸运数现在给定 n ,求 [1, n] 中有几个幸运数输入第一行一个正整数 n1 ≤ n ≤ 1012输出输出有几个幸运数样例输入10样例输出10这道题以前貌似做过,思路:如果直接dp,发现dp数组存不下sum...原创 2018-08-07 11:09:35 · 788 阅读 · 0 评论 -
CodeForces - 628D (数位dp)
Consider the decimal presentation of an integer. Let's call a number d-magic if digit d appears in decimal presentation of the number on even positions and nowhere else.For example, the numbers 1727...原创 2019-01-26 21:02:07 · 364 阅读 · 1 评论 -
self 同类分布 (数位dp)
给出a,b,求出[a,b]中各位数字之和能整除原数的数的个数。Sample Input10 19Sample Output3Hint【约束条件】1 ≤ a ≤ b ≤ 10^18题目大概:题目比较简短。思路:这个题时间限制比较大,数据又比较大,所以可以枚举各位数字之和来解决问题,因为最多18位,最大为9,所以各位和最大为162。枚举各位和,找出符合原创 2017-11-02 00:12:28 · 453 阅读 · 0 评论 -
Mountain Number (数位dp)
One integer number x is called "Mountain Number" if:(1) x>0 and x is an integer;(2) Assume x=a[0]a[1]...a[len-2]a[len-1](0≤a[i]≤9, a[0] is positive). Any a[2i+1] is larger or equal to a[2i] and a[原创 2017-11-02 00:06:40 · 377 阅读 · 0 评论 -
Investigation (数位dp)
An integer is divisible by 3 if the sum of its digits is also divisible by 3. For example, 3702 is divisible by 3 and 12 (3+7+0+2) is also divisible by 3. This property also holds for the integer 9.原创 2017-11-01 23:52:32 · 331 阅读 · 0 评论 -
H - Bomb
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-10-29 22:31:04 · 265 阅读 · 0 评论 -
G - B-number
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原创 2017-10-29 22:27:17 · 273 阅读 · 0 评论 -
M - windy数
windy定义了一种windy数。不含前导零且相邻两个数字之差至少为2的正整数被称为windy数。 windy想知道,在A和B之间,包括A和B,总共有多少个windy数?Input 包含两个整数,A B。Output 一个整数Sample Input【输入样例一】1 10【输入样例二】25 50Sample Output【输出样例一】9【输出样例二原创 2017-10-29 22:33:56 · 286 阅读 · 0 评论 -
Amount of Degrees (数位dp)
Create a code to determine the amount of integers, lying in the set [ X;Y] and being a sum of exactly K different integer degrees of B. Example. Let X=15, Y=20,K=2, B=2. By this example 3 nu原创 2017-11-09 21:00:36 · 1518 阅读 · 0 评论 -
Beautiful numbers (数位dp)
Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number isbeautiful if and only if it is divisible by each of its nonzero digits. We will not argue wit原创 2017-11-09 21:25:54 · 1488 阅读 · 0 评论 -
Apocalypse Someday (数位dp+二分)
The number 666 is considered to be the occult “number of the beast” and is a well used number in all major apocalypse themed blockbuster movies. However the number 666 can’t always be used in the scri原创 2017-11-09 21:13:00 · 313 阅读 · 0 评论 -
Palindromic Numbers (数位dp)
A palindromic number or numeral palindrome is a 'symmetrical' number like 16461 that remains the same when its digits are reversed. In this problem you will be given two integersi j, you have to fin原创 2017-11-09 21:42:29 · 351 阅读 · 0 评论 -
count 数字计数 (数位dp)
给定两个正整数a和b,求在[a,b]中的所有整数中,每个数码(digit)各出现了多少次。Input输入文件中仅包含一行两个整数a、b,含义如上所述。Output输出文件中包含一行10个整数,分别表示0-9在[a,b]中出现了多少次。Sample Input1 99Sample Output9 20 20 20 20 20 20 20 20 20Hint30%的数据中,a原创 2017-11-09 21:56:24 · 1858 阅读 · 0 评论 -
处女座和小姐姐(三)(数位dp)
链接:https://ac.nowcoder.com/acm/contest/329/G来源:牛客网 题目描述经过了选号和漫长的等待,处女座终于拿到了给小姐姐定制的手环,小姐姐看到以后直呼666!处女座其实也挺喜欢6这个数字的,实际上他做手环的时候选取的k=6。所以他对于包含数码6的数字极其敏感。每次看到像4567这样的数字的时候他的心就像触电了一样,想起了小姐姐。现在你要给处女座...原创 2019-01-26 22:29:53 · 182 阅读 · 0 评论