子序列
文章平均质量分 56
云淡风轻jzl
一路脚踏实地,不忘仰望星空。
展开
-
QDUOJ计科寒假测试赛01-LB竟然当众开车!-贪心求最长下降子序列
题目描述:LB有n列火车。火车按照序号从1~n排列在入口轨道上(1号火车在最前方,即下图入口最右方),火车的行进方向都是从左至右。有钱的LB想在入口与出口之间修建k条中部轨道,火车可从入口轨道进入任意一条中部轨道,最后都从出口轨道驶出。LB想让火车按照价格递增的顺序驶出,便找到JZL,问至少要修建多少条中部轨道,可是JZL天生愚钝,你能帮他解决这个问题吗?注:下图中的数字是价格而不是序号。输入描述:第一行输入一个整数n,表示火车的数量。接下来n行,每行一个整数,第i+1行表示第i列火车的价原创 2021-01-20 17:22:47 · 157 阅读 · 1 评论 -
牛客3007C-汉诺塔-最长下降子序列+贪心模拟
链接:https://ac.nowcoder.com/acm/contest/3007/C来源:牛客网题目描述:现在你有 N 块矩形木板,第 i 块木板的尺寸是 Xi*Yi,你想用这些木板来玩汉诺塔的游戏。我们知道玩汉诺塔游戏需要把若干木板按照上小下大的顺序堆叠在一起,但因为木板是矩形,所以有一个问题:第 i 块木板能放在第 j 块木板上方当且仅当 Xi<Xj 且 Yi<Yj...原创 2020-02-15 20:12:32 · 314 阅读 · 0 评论 -
Subsequence-后继数组+vector
题目描述:Give a string S and N string Ti, determine whether Ti is a subsequence of S.If ti is subsequence of S, print YES,else print NO.If there is an array {K1,K2,K3,⋯ ,Km} so that 1≤K1<K2<K3<...原创 2019-04-21 09:59:06 · 185 阅读 · 0 评论 -
HDU 1025-最长上升子序列-Constructing Roads In JGShining's Kingdom
JGShining’s kingdom consists of 2n(n is no more than 500,000) small cities which are located in two parallel lines.Half of these cities are rich in resource (we call them rich cities) while the other...原创 2019-07-24 15:28:11 · 131 阅读 · 0 评论 -
2019CCPC-江西省赛-Wave
Problem DescriptionAvin is studying series. A series is called “wave” if the following conditions are satisfied:It contains at least two elements;All elements at odd positions are the same;All el...原创 2019-07-21 15:46:30 · 331 阅读 · 0 评论 -
HDU 5707-Combine String-动态规划
Given three strings a, b and c, your mission is to check whether c is the combine string of a and b.A string c is said to be the combine string of a and b if and only if c can be broken into two subs...原创 2019-07-26 09:35:43 · 257 阅读 · 2 评论 -
HDU 1160-FatMouse's Speed-最长下降子序列-两种求法
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...原创 2019-07-26 11:27:40 · 143 阅读 · 0 评论