随笔分类 -  数位DP

HDU 4734 F(x) (2013成都网络赛,数位DP)
摘要:F(x)Time Limit: 1000/500 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 382Accepted Submission(s): 137Problem 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 giv 阅读全文

posted @ 2013-09-15 00:25 kuangbin 阅读(3243) 评论(1) 推荐(0) 编辑

ZOJ 3494 BCD Code(AC自动机+数位DP)
摘要:BCD CodeTime Limit:5 Seconds Memory Limit:65536 KBBinary-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 digit is stored in a 4-bit nibble:Decimal: 0 1 ... 阅读全文

posted @ 2013-06-30 22:29 kuangbin 阅读(2508) 评论(0) 推荐(0) 编辑

HDU 4507 吉哥系列故事——恨7不成妻(数位DP)
摘要:吉哥系列故事——恨7不成妻Time Limit: 1000/500 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 746Accepted Submission(s): 227Problem Description 单身! 依然单身! 吉哥依然单身! DS级码农吉哥依然单身! 所以,他生平最恨情人节,不管是214还是77,他都讨厌! 吉哥观察了214和77这两个数,发现: 2+1+4=7 7+7=7*2 77=7*11 最终,他发现原来这一切归根到底都是因为和7有... 阅读全文

posted @ 2013-05-01 15:28 kuangbin 阅读(4905) 评论(0) 推荐(2) 编辑

SPOJ 10606. Balanced Numbers (数位DP)
摘要:题目链接:http://www.spoj.com/problems/BALNUM/这题要求出现的数字,偶数出现奇数次,奇数出现偶数次。用三进制表示0~9的状态//============================================================================// Name : SPOJ.cpp// Author : // Version :// Copyright : Your copyright notice// Description : Hello World in C++, Ansi-style... 阅读全文

posted @ 2013-05-01 11:32 kuangbin 阅读(813) 评论(0) 推荐(0) 编辑

HDU 3709 Balanced Number ZOJ 3416 Balanced Number(数位DP)
摘要:Balanced NumberTime Limit:5 Seconds Memory Limit:65536 KBA 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 dis 阅读全文

posted @ 2013-05-01 10:52 kuangbin 阅读(772) 评论(0) 推荐(0) 编辑

HDU 3652 B-number(数位DP)
摘要:B-numberTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1231Accepted Submission(s): 651Problem 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 b 阅读全文

posted @ 2013-05-01 00:44 kuangbin 阅读(927) 评论(0) 推荐(0) 编辑

CF 55D Beautiful numbers(数位DP)
摘要:D. Beautiful numberstime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVolodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number isbeautifulif and only if it is divisible by each of its nonzero digits. We 阅读全文

posted @ 2013-05-01 00:20 kuangbin 阅读(2084) 评论(0) 推荐(1) 编辑

HDU 4352 XHXJ's LIS(数位DP)
摘要:XHXJ's LISTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 376Accepted Submission(s): 163Problem Description#define xhxj (Xin Hang senior sister(学姐))If you do not know xhxj, then carefully reading the entire description is very important.As the 阅读全文

posted @ 2013-05-01 00:03 kuangbin 阅读(3391) 评论(0) 推荐(1) 编辑

POJ 3252 Round Numbers(数位DP)
摘要:Round NumbersTime Limit:2000MSMemory Limit:65536KTotal Submissions:6983Accepted:2384DescriptionThe 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 阅读全文

posted @ 2013-04-30 22:25 kuangbin 阅读(696) 评论(0) 推荐(0) 编辑

UESTC 1307 windy数(数位DP)
摘要:题目链接:http://acm.uestc.edu.cn/problem.php?pid=1307windy数Time Limit:1000 msMemory Limit:65536 kBSolved:104Tried:720SubmitStatusBest SolutionBackDescriptionwindy定义了一种windy数。不含前导零且相邻两个数字之差至少为2的正整数被称为windy数。windy想知道,在A和B之间,包括A和B,总共有多少个windy数?Input包含两个整数,A B。满足 1 #include #include #include using namespace 阅读全文

posted @ 2013-04-30 21:52 kuangbin 阅读(679) 评论(0) 推荐(0) 编辑

HDU 2089 不要62(数位DP)
摘要:不要62Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11833Accepted Submission(s): 3691Problem Description杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。不吉利的数字为所有含有4或62的号码。例如:62315 73418 8 阅读全文

posted @ 2013-04-30 21:17 kuangbin 阅读(2042) 评论(0) 推荐(0) 编辑

HDU 3555 Bomb(数位DP)
摘要:BombTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 3362Accepted Submission(s): 1185Problem 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 bom 阅读全文

posted @ 2013-04-30 21:07 kuangbin 阅读(1192) 评论(0) 推荐(0) 编辑

导航

JAVASCRIPT: