
动态规划
文章平均质量分 59
出尘呢
广告位招租!
展开
-
D. Omkar and Medians——Codeforces Round #724 (Div. 2)
https://codeforces.com/contest/1536/problem/D这个又是往状态转移想,dp思路cd很常见!下一个状态,只能改变最多一个排位也一定可以改变一个排位。所以只要贪心,看上一个状态到当前是否可以即可,即不是到不了,更好判断。还有知识点:set是有序的next(p)next(p)next(p)和prev(p)prev(p)prev(p)函数会返回p的下一个/上一个指针。一个小技巧:墙:用INF和-INF,不用特判一个小bug:注意不要找到flag就习惯性b原创 2021-06-08 01:06:21 · 460 阅读 · 0 评论 -
【DP坑多】HNU2021校赛Doorman门童
DescriptionPlayf came to a mysterious place as a volunteer. His task was to receive contestants at the door ofthe hotel. This profession is called doorman. It is known that the distance from the resting sofa to the door is L meters, and the walking speed原创 2021-05-28 12:48:30 · 206 阅读 · 0 评论 -
(复习次数:1——看题解)hdu1024 max sum plus plus
Now I think you have got an AC in Ignatius.L’s “Max Sum” problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now you are faced with a more difficult problem.Given a consecutive number sequence S1, S2, S3, S4 … Sx, … Sn原创 2021-02-15 21:11:32 · 117 阅读 · 0 评论 -
acm选修课——动态规划
动态规划动态规划动态规划概念对比证明例题1.最长上升子序列2.数塔3.最长公共子序列4.字符串的修改5.海盗分赃6.The Uxuhul Voting System附加题:1.Doing Homework HDU - 1074【状压dp】2.hdu1024 max sum plus plus动态规划动态规划概念求最优,满足最优性原理:有最优子结构,从小规模最优化到大规模最优化又名:记忆化搜索对比贪心:从小到大分治:子问题求解独立证明求状态转移方程的过程就是暴力剪枝,记忆化搜索例题原创 2021-05-18 21:21:06 · 253 阅读 · 0 评论 -
(复习次数:1)HDU1257-最少拦截系统
某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹.怎么办呢?多搞几套系统呗!你说说倒蛮容易,成本呢?成本是个大问题啊.所以俺就到这里来求救了,请帮助计算一下最少需要多少套拦截系统.Input输入若干组数据.每组数据包括:导弹总个数(正整数),导弹依此飞来的高度(雷达给出的高度数据是不大于原创 2021-02-22 18:56:10 · 136 阅读 · 0 评论 -
(复习次数:1)HDJ 1176 免费馅饼 -- 动态规划
Problem Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老呆在房间里玩游戏,虽然在游戏中是个身手敏捷的高手,但在现实中运动神经特别迟钝,每秒种只有在移动不超过一米的范围内接住坠落的馅饼。现在给这条小径如图标原创 2021-02-21 00:06:29 · 139 阅读 · 0 评论 -
(复习次数:1)HDU 1114 piggy-bank【完全背包】
Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The idea behind is simple. Whenever some ACM member has any small money, he takes原创 2021-02-19 21:21:29 · 122 阅读 · 0 评论 -
(复习次数:1)HDU 1160 FatMouse‘s Speed【C++练习题】
FatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large a subset of this data as possible into a sequence so that the weights are increasing, but the speeds are原创 2021-02-22 21:03:48 · 145 阅读 · 0 评论 -
D. Armchairs——Educational Codeforces Round 109 (Rated for Div. 2)
D. Armchairstime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputThere are n armchairs, numbered from 1 to n from left to right. Some armchairs are occupied by people (at most one person per armchair),原创 2021-05-16 20:54:05 · 372 阅读 · 2 评论 -
C. Planar Reflections【动态规划图解】——CodeCraft-21 and Codeforces Round #711 (Div. 2)
C. Planar Reflectionstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputGaurang has grown up in a mystical universe. He is faced by n consecutive 2D planes. He shoots a particle of decay age k at the p原创 2021-05-01 02:31:14 · 305 阅读 · 1 评论