随笔分类 -  经典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 r 阅读全文
posted @ 2017-08-21 21:58 Pretty9 阅读(207) 评论(0) 推荐(0)
摘要:In a few months the European Currency Union will become a reality. However, to join the club, the Maastricht criteria must be fulfilled, and this is n 阅读全文
posted @ 2017-08-21 21:54 Pretty9 阅读(256) 评论(0) 推荐(0)
摘要:A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = <x1, x2, ..., xm> another se 阅读全文
posted @ 2017-08-21 21:53 Pretty9 阅读(221) 评论(0) 推荐(0)
摘要: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 r 阅读全文
posted @ 2017-08-21 21:52 Pretty9 阅读(211) 评论(0) 推荐(0)
摘要:某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹. 怎么办呢?多搞几套系统呗!你说 阅读全文
posted @ 2017-08-21 21:50 Pretty9 阅读(117) 评论(0) 推荐(0)
摘要:A numeric sequence of ai is ordered if a1 < a2 < ... < aN. Let the subsequence of the given numeric sequence ( a1, a2, ..., aN) be any sequence ( ai1, 阅读全文
posted @ 2017-08-21 21:49 Pretty9 阅读(222) 评论(0) 推荐(0)
摘要:Given a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1*1 or greater located within the 阅读全文
posted @ 2017-08-21 21:47 Pretty9 阅读(167) 评论(0) 推荐(0)
摘要:Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in th 阅读全文
posted @ 2017-08-21 21:46 Pretty9 阅读(216) 评论(0) 推荐(0)
摘要:Summer is coming! It's time for Iahub and Iahubina to work out, as they both want to look hot at the beach. The gym where they go is a matrix a with n 阅读全文
posted @ 2017-08-21 21:45 Pretty9 阅读(268) 评论(0) 推荐(0)
摘要:在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的: 有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少? 已经告诉你了,这是个DP的题目,你能AC吗? Input输入数据首先包括一个整数C,表示测试实例的个数,每个测试实例的第一行是一个 阅读全文
posted @ 2017-08-21 21:44 Pretty9 阅读(191) 评论(0) 推荐(0)