
数位dp
Kirito_Acmer
这个作者很懒,什么都没留下…
展开
-
windy数
不含前导零且相邻两个数字之差至少为2的正整数被称为windy数。windy想知道,在A和B之间,包括A和B,总共有多少个windy数?这是一道数位dp,设dp[i][j],dp[i][j]表示i为长度,j为最高位上的数字的个数。#include#include#includeint dp[100][14];void init(){int i,j,k;memset原创 2015-04-19 10:20:23 · 964 阅读 · 0 评论 -
hdu3709 Balanced Number
Problem DescriptionA 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 digi原创 2015-04-20 17:31:19 · 493 阅读 · 0 评论 -
hdu3565 Bi-peak Number (有上界和下界的数位dp)
Problem DescriptionA peak number is defined as continuous digits {D0, D1 … Dn-1} (D0 > 0 and n >= 3), which exist Dm (0 Di+1 (m A number is called bi-peak if it is a concatenation of two peak n原创 2016-04-06 21:56:47 · 943 阅读 · 0 评论 -
codeforces628D. Magic Numbers (数位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原创 2016-04-06 10:37:37 · 884 阅读 · 0 评论 -
zjnu1749 PAROVI (数位dp)
DescriptionThe distance between two integers is defined as the sum of the absolute result of subtracting their digits. For example, the distance between the numbers 4561 and 3278 is |4 – 3| + |5 -原创 2016-03-22 20:54:13 · 712 阅读 · 0 评论 -
hdu5432Rikka with Array (数位dp+十进制转化为二进制)
Problem DescriptionAs we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them:Yuta has an array A of length原创 2016-04-01 16:15:25 · 646 阅读 · 0 评论 -
hdu4734 F(x) (数位dp)
Problem DescriptionFor a decimal number x with n digits (AnAn-1An-2 ... A2A1), we define its weight as F(x) = An * 2n-1 + An-1 * 2n-2 + ... + A2 * 2 + A1 * 1. Now you are given two numbers A and原创 2016-03-20 11:17:55 · 508 阅读 · 0 评论 -
poj3252 Round Numbers (数位dp)
DescriptionThe 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) i原创 2016-03-04 15:38:56 · 625 阅读 · 0 评论 -
hdu4352 XHXJ's LIS (数位dp)
Problem Description#define xhxj (Xin Hang senior sister(学姐)) If you do not know xhxj, then carefully reading the entire description is very important.As the strongest fighting force in UESTC,原创 2016-03-19 21:39:15 · 584 阅读 · 0 评论 -
hdu4507吉哥系列故事——恨7不成妻 (数位dp)
Problem Description 单身! 依然单身! 吉哥依然单身! DS级码农吉哥依然单身! 所以,他生平最恨情人节,不管是214还是77,他都讨厌! 吉哥观察了214和77这两个数,发现: 2+1+4=7 7+7=7*2 77=7*11 最终,他发现原来这一切归根到底都是因为和7有关!所以,他现在甚至讨厌一切和7有关原创 2016-03-06 10:40:53 · 1056 阅读 · 0 评论 -
zoj3494 BCD Code(AC自动机+数位dp)
Binary-coded decimal (BCD) is an encoding for decimal numbers in which each digit is represented by its own binary sequence. To encode a decimal number using the common BCD encoding, each decimal di原创 2016-03-29 21:57:23 · 561 阅读 · 0 评论 -
hdu3652B-number (数位dp)
Problem DescriptionA 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-numbe原创 2016-03-04 17:37:09 · 485 阅读 · 0 评论 -
A. Little Elephant and Interval
The Little Elephant very much loves sums on intervals.This time he has a pair of integers l and r (l ≤ r). The Little Elephant has to find the number of such integers x (l ≤ x ≤ r), that the f原创 2015-04-19 20:44:37 · 1008 阅读 · 0 评论 -
hdu3555 Bomb(要49)
Problem DescriptionThe 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 curren原创 2015-04-23 11:46:50 · 723 阅读 · 0 评论 -
hdu 2089不要62 (数位dp)
Problem Description杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。不吉利的数字为所有含有4或62的号码。例如:62315 73418 88914都属于不吉利号码。但是,61152虽然含有6和原创 2015-04-22 16:17:20 · 536 阅读 · 0 评论 -
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 wi原创 2016-03-06 10:51:31 · 804 阅读 · 0 评论