![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
动态规划
心悦灵溪
这个作者很懒,什么都没留下…
展开
-
牛客练习赛60 C-操作集锦 【动态规划】
传送门:C-操作集锦题目描述有一款自走棋有26种操作,每种操作我们都用 a,b,c,d,…,x,y,z 的符号来代替.现在牛牛有一个长度为nn的操作序列,他现在可以从里面拿出某些操作来组合成一个操作视频, 比如说操作序列是abcdabcd,那么操作视频就有a,b,c,d,ab,ac,ad 等(也就是操作序列的子序列).他现在想知道长度为k且本质不同的操作视频有多少种.比如对于aba...原创 2020-03-29 15:37:52 · 245 阅读 · 0 评论 -
Codeforces 1256E Yet Another Division Into Teams 【dp】
传送门:Codeforces 1256EYet Another Division Into Teamstime limit per test: 2 secondsThere are n students at your university. The programming skill of the i-th student is ai. As a coach, you want t...原创 2019-11-21 11:09:43 · 169 阅读 · 0 评论 -
P4290 玩具取名 【区间dp】
传送门:P4290题目描述某人有一套玩具,并想法给玩具命名。首先他选择WING四个字母中的任意一个字母作为玩具的基本名字。然后他会根据自己的喜好,将名字中任意一个字母用“WING”中任意两个字母代替,使得自己的名字能够扩充得很长。现在,他想请你猜猜某一个很长的名字,最初可能是由哪几个字母变形过来的。输入格式第一行四个整数W、I、N、G。表示每一个字母能由几种两个字母所替代。接下...原创 2019-11-03 16:20:14 · 173 阅读 · 0 评论 -
Codeforces 1249E By Elevator or Stairs?【dp】
传送门:By Elevator or Stairs?By Elevator or Stairs?You are planning to buy an apartment in a n-floor building. The floors are numbered from 1 to n from the bottom to the top. At first for each floo...原创 2019-10-27 13:34:02 · 352 阅读 · 0 评论 -
2019 ICPC Nanjing网络赛 D题 Robots 【期望dp】
传送门:RobotsRobotsGiven a directed graph with no loops which starts at node 11 and ends at node nn.There is a robot who starts at 11, and will go to one of adjacent nodes or stand still with equa...原创 2019-09-02 17:24:38 · 382 阅读 · 2 评论 -
洛谷 P1284 三角形牧场【DP】
传送门:P1284题目描述和所有人一样,奶牛喜欢变化。它们正在设想新造型的牧场。奶牛建筑师Hei想建造围有漂亮白色栅栏的三角形牧场。她拥有N(3≤N≤40)块木板,每块的长度Li(1≤Li≤40)都是整数,她想用所有的木板围成一个三角形使得牧场面积最大。请帮助Hei小姐构造这样的牧场,并计算出这个最大牧场的面积。输入格式第1行:一个整数N第2…N+1行:每行包含一个整数,即是木...原创 2019-08-22 16:39:58 · 491 阅读 · 0 评论 -
洛谷 P1281 书的复制 【区间dp+贪心】
传送门:P1281题目背景大多数人的错误原因:尽可能让前面的人少抄写,如果前几个人可以不写则不写,对应的人输出0 0。不过,已经修改数据,保证每个人都有活可干。题目描述现在要把m本有顺序的书分给k给人复制(抄写),每一个人的抄写速度都一样,一本书不允许给两个(或以上)的人抄写,分给每一个人的书,必须是连续的,比如不能把第一、第三、第四本书给同一个人抄写。现在请你设计一种方案,使...原创 2019-08-22 11:54:14 · 317 阅读 · 0 评论 -
最长上升子序列的打印【 O(n^2) 】
#include<iostream>#include<algorithm>#include<cstring>#include<cstdio>#include<cmath>#include<stack>#define ll long long#define inf 0x3f3f3f3fusing namespac...原创 2019-07-22 17:47:54 · 306 阅读 · 0 评论 -
Codeforces 1197D Yet Another Subarray Problem 【dp】
传送门:Codeforces 1197DYet Another Subarray ProblemProblem DescriptionYou are given an array a1,a2,…,an and two integers m and k.You can choose some subarray al,al+1,…,ar−1,ar.The cost of subarr...原创 2019-07-25 10:20:21 · 177 阅读 · 0 评论 -
Codeforces 1183H Subsequences (hard version)
传送门:Codeforces 1183H Subsequences (hard version)time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputProblem DescriptionA subsequence is a s...原创 2019-07-24 15:18:06 · 254 阅读 · 0 评论 -
HDU 2845 Beans
传送门:HDU 2845BeansTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem DescriptionBean-eating is an interesting game, everyone owns an MN matrix, which is...原创 2019-07-19 16:42:28 · 120 阅读 · 0 评论 -
HDU 2697 WOJ 【DP】
传送门:HDU 2697WOJTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem DescriptionAlex likes solving problems on WOJ (http://acm.whu.edu.cn/oak). As we all k...原创 2019-07-19 14:51:01 · 117 阅读 · 0 评论 -
HDU 1423
传送门:HDU 1423Greatest Common Increasing SubsequenceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionThis is a problem from ZOJ 2432.To make ...原创 2019-07-16 19:32:19 · 164 阅读 · 0 评论 -
HDU 1025【最长上升子序列+时间优化】
传送门:HDU 1025Constructing Roads In JGShining's Kingdom Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionJGShining’s kingdom consists of 2n(...原创 2019-07-16 17:40:56 · 501 阅读 · 0 评论 -
HDU 5532 Almost Sorted Array
传送门:HDU 5532Almost Sorted ArrayTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Problem DescriptionWe are all familiar with sorting algorithms: quick sort, ...原创 2019-07-16 14:49:47 · 131 阅读 · 0 评论