DP
让我改变你的心智
这个作者很懒,什么都没留下…
展开
-
ccf 有趣的数 DP
思路:我们通过规则可以发现,任意一个符合要求的数的首位只能是2。那么按照规则我们可以得出6种状态: 1 只含有 2 2 只含有 2 0 3 只含有 2 3 4 只含有 2 0 1 5 只含有 2 0 3 6 含有全部四中数 dp [ i ] [ j ] 表示一个 i 位数满足第 j 中状态。那么这一状态一定可以原创 2016-09-09 20:00:56 · 334 阅读 · 0 评论 -
HDU 6321 Dynamic Graph Matching 状压DP
Problem Description In the mathematical discipline of graph theory, a matching in a graph is a set of edges without common vertices. You are given an undirected graph with n vertices, labeled by 1,2,...原创 2018-07-31 16:35:25 · 187 阅读 · 0 评论 -
codeforces 917B. MADMAX
B. MADMAX time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output As we all know, Max is the best video game player among her原创 2018-01-31 19:34:05 · 620 阅读 · 0 评论 -
HDU 3709 Balanced Number
Balanced Number Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others) Total Submission(s): 6344 Accepted Submission(s): 3030 Problem Description A balance原创 2017-09-12 23:25:05 · 192 阅读 · 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原创 2017-09-12 22:49:01 · 681 阅读 · 0 评论 -
HDU 2089 数位DP入门题
不要62 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 34754 Accepted Submission(s): 12596 Problem Description 杭州人称那些傻乎乎粘嗒嗒的人为62(音原创 2016-08-15 21:06:45 · 373 阅读 · 0 评论 -
SPOJ - BALNUM Balanced Numbers 数位dp+状态压缩
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 represen原创 2017-09-19 14:29:27 · 354 阅读 · 0 评论 -
1026: [SCOI2009]windy数
Description windy定义了一种windy数。不含前导零且相邻两个数字之差至少为2的正整数被称为windy数。 windy想知道, 在A和B之间,包括A和B,总共有多少个windy数? Input 包含两个整数,A B。 Output 一个整数 Sample Input 【输入样例一】 1 1原创 2017-06-30 13:07:27 · 247 阅读 · 0 评论 -
cf Manthan, Codefest 17 E. Salazar Slytherin's Locket
E. Salazar Slytherin's Locket time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Harry came to know from Dumbledore that原创 2017-09-25 13:18:06 · 370 阅读 · 0 评论 -
codeforces 55D. Beautiful numbers
D. Beautiful numbers time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Volodya is an odd boy and his taste is strange a原创 2017-08-30 22:34:33 · 272 阅读 · 0 评论 -
HDU 3555 Bomb 数位DP
Bomb Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others) Total Submission(s): 15298 Accepted Submission(s): 5525 Problem Description The counter-terrori原创 2016-08-15 22:17:11 · 264 阅读 · 0 评论 -
HDU 4734 F(x) 数位DP
F(x) Time Limit: 1000/500 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 6398 Accepted Submission(s): 2465 Problem Description For a decimal number x原创 2017-09-14 22:13:42 · 174 阅读 · 0 评论 -
度度熊与邪恶大魔王
度度熊与邪恶大魔王 Accepts: 845 Submissions: 5001 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description 度度熊为了拯救可爱的公主,于是与邪恶大魔王战斗起来原创 2017-08-05 15:30:27 · 2429 阅读 · 1 评论 -
580D - Kefa and Dishes
When Kefa came to the restaurant and sat at a table, the waiter immediately brought him the menu. There were n dishes. Kefa knows that he needs exactly m dishes. But at that, he doesn't want to orde原创 2017-08-04 14:32:32 · 294 阅读 · 0 评论 -
HDU 1520 Anniversary party
Problem Description There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees. It means that the supervi原创 2017-08-04 12:05:47 · 179 阅读 · 0 评论 -
ACM-ICPC 2017 Asia Urumqi A. Coins 概率dp
Alice and Bob are playing a simple game. They line up a row of nn identical coins, all with the heads facing down onto the table and the tails upward. For exactly mm times they select any kk of the c...原创 2018-10-16 15:45:43 · 227 阅读 · 0 评论