![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
dp
cwb丶
这个作者很懒,什么都没留下…
展开
-
B2. K for the Price of One (Hard Version) Codeforces Round #610 (Div. 2)B2
Codeforces Round #610 (Div. 2)B2. K for the Price of One (Hard Version)time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThis is...原创 2019-12-26 21:10:33 · 274 阅读 · 0 评论 -
Educational Codeforces Round 76 (Rated for Div. 2) E 最长不下降子序列
E. The Contesttime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputA team of three programmers is going to play a contest. The contes...原创 2019-11-14 09:40:18 · 282 阅读 · 2 评论 -
Halloween Costumes LightOJ - 1422 区间dp
小灰灰参加圣诞节的一些派对,并且需要穿上对应派对的衣服,所以他需要多次换衣服,为了方便,他可以选择脱掉一些衣服或者穿上新衣服,比如说,他穿着超人的衣服,外面又穿着死侍的衣服,当他要参加超人服装派对时,他可以选择脱掉死侍的衣服(因为死侍衣服的里面有超人的衣服),或者他可以在穿一件超人的衣服,小灰灰是个爱干净的人,当他脱下死侍的衣服后,如果需要再穿死侍的衣服,他会选择再穿一件新的。(如果他先穿A衣服,...原创 2019-10-29 19:01:48 · 225 阅读 · 0 评论 -
[HDU-2476]String painter 区间dp
String painterHDU - 2476题目描述有两个长度相等,都只由小写字母构成的字符串A和B. 现在你有一把充满魔♂力的刷子。使用这把刷子,你可以把字符串中连续的一段区间刷♂成一个相同的字符,例如,对于字符串"vandarkholme",把区间[3,6]刷成'd',可以变成"vanddddholme"。现在你要用这把刷♂子把字符串A变成B,最少要刷多少次?输入多...原创 2019-10-28 21:32:27 · 231 阅读 · 0 评论 -
Treats for the Cows (简单dp)
给你n个数字v(1),v(2),...,v(n-1),v(n),每次你可以取出最左端的数字或者取出最右端的数字,一共取n次取完。假设你第i次取的数字是x,你可以获得i*x的价值。你需要规划取数顺序,使获得的总价值之和最大。Input第一行一个数字n(1<=n<=2000)。下面n行每行一个数字v(i)。(1<=v(i)<=1000)Output输出一个数字...原创 2019-04-14 11:45:34 · 223 阅读 · 0 评论 -
2018南昌邀请赛网络赛d题
刚开始看到此提时也没想到dp但是仔细一思考可以发现确实是我们只要单独处理第一位数剩下的符号和数字看成一个物品进行类似背包的dp即可首先预处理所有火柴和符号根据输入的总火柴进行一次dp即可#include<iostream>#include<stdio.h>#include<algorithm>#include<cstri...原创 2019-04-22 12:56:12 · 162 阅读 · 0 评论 -
Coloring Brackets CodeForces - 149D 分治区间dp
Once Petya read a problem about a bracket sequence. He gave it much thought but didn't find a solution. Today you will face it.You are given strings. It represents a correct bracket sequence. A cor...原创 2019-04-29 21:31:42 · 141 阅读 · 0 评论 -
D - Multiplication Puzzle POJ - 1651(区间dp)
The multiplication puzzle is played with a row of cards, each containing a single positive integer. During the move player takes one card out of the row and scores the number of points equal to the pr...原创 2019-05-08 18:30:20 · 122 阅读 · 0 评论 -
2018 东北赛i 简单dpI - Problem I. Spell Boost HDU - 6508
Shadowverse is a funny card game. One day you are playing a round of this game.You have n cards, each with two attributes wi and xi. If you use card i, you will cost wi points of power and cause xi ...原创 2019-05-01 14:27:12 · 317 阅读 · 2 评论 -
Food Delivery ZOJ - 3469 (区间dp)
When we are focusing on solving problems, we usually prefer to stay in front of computers rather than go out for lunch. At this time, we may call for food delivery.Suppose there are N people living ...原创 2019-05-09 13:02:13 · 171 阅读 · 0 评论 -
分治 (2019 河北省赛) (区间dp)
链接:https://ac.nowcoder.com/acm/contest/903/C来源:牛客网题目描述你是DEEP国的大军师,辅佐一个非常有野心的国王,这位国王非常有野心,他计划攻占 n 个国家。在地图上,这些国家排成一行。探子已经查明,当攻打一个国家 i 时,为了防止国家间的联合对抗,需要给该国家周围,所有未被攻占的国家支付costicosti 个金币,即对于国家 i,它左...原创 2019-05-30 11:41:30 · 304 阅读 · 0 评论 -
E - Sum Equals Xor(dp)(好题)
Time Limit: 2 sec / Memory Limit: 1024 MBScore :500500pointsProblem StatementYou are given a positive integerLLin base two. How many pairs of non-negative integers(a,b)(a,b)satisfy the fol...原创 2019-06-10 17:24:45 · 888 阅读 · 0 评论 -
POJ - 1205 Water Treatment Plants (大数dp)(java)
River polution control is a major challenge that authorities face in order to ensure future clean water supply. Sewage treatment plants are used to clean-up the dirty water comming from cities before ...原创 2019-08-10 15:41:00 · 143 阅读 · 0 评论 -
冰水挑战(简单dp)
冰水挑战Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2397Accepted Submission(s): 429Problem DescriptionPolar Bear Pitching helps you...原创 2019-04-14 11:34:06 · 159 阅读 · 0 评论 -
对lis问题的回顾
lis有复杂度哦(n*log(n))的算法实质就是维护一个答案序列 将每次更优的的放在应该在的地方下面是求严格递增的lis#include<cstring>#include<cstdio>#include<iostream>#include<algorithm>using namespace std;int a[100005]...原创 2019-04-02 09:46:37 · 108 阅读 · 0 评论 -
diagrams(哈尔滨工程大学ACM预热赛 A)(高精度 dp)
链接:https://ac.nowcoder.com/acm/contest/554/A来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述小虎刚刚上了幼儿园,老师让他做一个家庭作业:首先画3个格子,第二行有2个格子,第三行有1个格子。每行的格子从左到右可以放棋子,但要求...原创 2019-04-11 09:01:45 · 198 阅读 · 0 评论 -
牛客练习赛41 b 666RPG (01背包)
时间限制:C/C++ 2秒,其他语言4秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述在欧美,“666”是个令人极其厌恶和忌讳的数,被称为“野兽数”。相传,尼禄,这位历史上以暴君著称的古罗马皇帝,在一次罗马大火后,无端指控是基督徒焚烧了罗马,并对他们进行大肆镇压。尼禄死后,部分基督徒出于对尼禄的恐惧,相信他并没有死去,而且...原创 2019-03-03 09:29:44 · 188 阅读 · 0 评论 -
Bone Collector II(背包 求第k优解)
C - Bone Collector IIThe title of this problem is familiar,isn't it?yeah,if you had took part in the "Rookie Cup" competition,you must have seem this title.If you haven't seen it before,it doesn'...原创 2019-03-06 14:29:56 · 219 阅读 · 0 评论 -
D - Cash Machine (多重背包二进制优化模板)
A Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The machine uses exactly N distinct bill denominations, say Dk, k...原创 2019-03-06 16:35:39 · 133 阅读 · 0 评论 -
Proud Merchants (关于背包顺序的一个反思)
Recently, iSea went to an ancient country. For such a long time, it was the most wealthy and powerful kingdom in the world. As a result, the people in this country are still very proud even if their n...原创 2019-03-06 18:06:27 · 367 阅读 · 0 评论 -
Charlie's Change POJ - 1787 (多重背包路径回溯)
Charlie is a driver of Advanced Cargo Movement, Ltd. Charlie drives a lot and so he often buys coffee at coffee vending machines at motorests. Charlie hates change. That is basically the setup of your...原创 2019-03-07 17:40:53 · 201 阅读 · 0 评论 -
不要62(简单数位dp)
杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。不吉利的数字为所有含有4或62的号码。例如:62315 73418 88914都属于不吉利号码。但是,61152虽然含有6和2,但不是62连号,所以不属于不吉利数字之...原创 2019-03-19 20:27:09 · 139 阅读 · 0 评论 -
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-03-20 08:35:01 · 123 阅读 · 0 评论 -
Balanced Number (思维数位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-03-20 20:02:59 · 209 阅读 · 0 评论 -
X mod f(x) (思维数位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-03-21 08:36:21 · 266 阅读 · 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 find...原创 2019-03-21 19:24:54 · 410 阅读 · 1 评论 -
True Liars (思维想法+带权并并查集+01背包)
After having drifted about in a small boat for a couple of days, Akira Crusoe Maeda was finally cast ashore on a foggy island. Though he was exhausted and despaired, he was still fortunate to remember...原创 2019-03-26 18:04:00 · 285 阅读 · 0 评论 -
hdu 2125 Local area network 简单dp之pair初体验
A local area network (LAN) supplies networking capability to a group of computers in close proximity to each other such as in an office building, a school, or a home. A LAN is useful for sharing resou...原创 2019-02-27 17:02:31 · 257 阅读 · 0 评论