![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
【动态规划】
文章平均质量分 79
kikiss_
这个作者很懒,什么都没留下…
展开
-
NYOJ 16 矩形嵌套(DAG上的动态规划)
【题目链接】NYOJ16-矩形嵌套【题意】有n个矩形,每个矩形可以用a,b来描述,表示长和宽。矩形X(a,b)可以嵌套在矩形Y(c,d)中当且仅当a【样例】样例输入1101 22 45 86 107 93 15 812 109 72 2样例输出5【分析】 矩形之间的“可嵌套”关系是一个典型的二元关系,二元关系可以用图来建模。如果矩形X可以嵌套在矩形Y里,就从原创 2017-08-18 14:16:01 · 548 阅读 · 0 评论 -
UVA 1025 A Spy in the Metro(dp)
【题目链接】UVA-1025【题意】 某城市的地铁是线性的,有n(2≤n≤50)个车站,从左到右编号为1~n。有M1辆列车从第1站开始往右开,还有M2辆列车从第n站开始往左开。在时刻0,Mario从第1站出发,目的是在时刻T(0≤T≤200)会见车站n的一个间谍。在车站等车时容易被抓,所以她决定尽量躲在开动的火车上,让在车站等待的总时间尽量短。列车靠站停车时间忽略不计,且M原创 2017-08-18 20:14:27 · 207 阅读 · 0 评论 -
动态规划-最大子段和系列问题
1.最大子段和给出一个长度为n的序列A1, A2,…, An,求最大连续和。即要求找到1≤i≤j≤n,使得Ai+Ai+1+…Aj尽量大,若结果小于0,则输出0。#include#include#includeusing namespace std;int main(){ int N,ipt,prem,sum,ans; scanf("%d",&N); su原创 2017-08-20 19:12:02 · 476 阅读 · 0 评论 -
ZOJ 3872 Beauty of Array(DP)
ZOJ 3872 Beauty of ArrayEdward has an array A with N integers. He defines the beauty of an array as the summation of all distinct integers in the array. Now Edward wants to know the summation of the原创 2017-04-13 22:25:40 · 359 阅读 · 0 评论 -
HDU 2639 Bone Collector II(01背包第K大解)
Bone Collector IITime Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5127 Accepted Submission(s): 2706Problem DescriptionThe title原创 2017-09-03 22:06:36 · 222 阅读 · 0 评论 -
ZOJ 3956 Course Selection System(01背包变形)
Course Selection SystemTime Limit: 1 Second Memory Limit: 65536 KB There are n courses in the course selection system of Marjar University. Thei-th course is described by two values:原创 2017-09-04 21:20:21 · 282 阅读 · 0 评论 -
01背包问题*3
HDU2546 饭卡Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 22098 Accepted Submission(s): 7730Problem Description电子科大本部食堂的饭原创 2017-09-02 20:11:16 · 304 阅读 · 0 评论