上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 37 下一页
摘要: Beans Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2637 Accepted Submission(s): 1302 Problem D 阅读全文
posted @ 2019-07-23 18:05 _Ackerman 阅读(563) 评论(0) 推荐(0) 编辑
摘要: 定义状态 F[i][j]表示以a串的前i个整数与b串的前j个整数且以b[j]为结尾构成的LCIS的长度。 状态转移方程: ①F[i][j] = F[i-1][j] (a[i] != b[j]) ②F[i][j] = max(F[i-1][k]+1) (1 <= k <= j-1 && b[j] > 阅读全文
posted @ 2019-07-23 17:05 _Ackerman 阅读(2409) 评论(0) 推荐(3) 编辑
摘要: 一.动态规划与递推解决01背包 初步分析: 0. 浅谈问题的分解 在处理到第i个物品时,可以假设一共只有i个物品,如果前面i-1个物品的总的最大价值已经定下来了,那么第i个物品选不选将决定这1~i个物品能带来的总的最大价值 刚刚是自顶向下,接下来反过来自底向上,第1个物品选不选可以轻松地用初始化解决 阅读全文
posted @ 2019-07-22 20:39 _Ackerman 阅读(434) 评论(0) 推荐(0) 编辑
摘要: 一,问题描述 给定两个字符串,求解这两个字符串的最长公共子序列(Longest Common Sequence)。比如字符串1:BDCABA;字符串2:ABCBDAB 则这两个字符串的最长公共子序列长度为4,最长公共子序列是:BCBA 二,算法求解 这是一个动态规划的题目。对于可用动态规划求解的问题 阅读全文
posted @ 2019-07-22 16:49 _Ackerman 阅读(915) 评论(0) 推荐(0) 编辑
摘要: 描述 一个数的序列bi,当b1 < b2 < ... < bS的时候,我们称这个序列是上升的。对于给定的一个序列(a1, a2, ..., aN),我们可以得到一些上升的子序列(ai1, ai2, ..., aiK),这里1 <= i1 < i2 < ... < iK <= N。比如,对于序列(1, 阅读全文
posted @ 2019-07-22 16:21 _Ackerman 阅读(994) 评论(0) 推荐(0) 编辑
摘要: Problem Description Given a specified total t and a list of n integers, find all distinct sums using numbers from the list that add up to t. For examp 阅读全文
posted @ 2019-07-21 19:30 _Ackerman 阅读(310) 评论(0) 推荐(0) 编辑
摘要: Problem Description 猜数字游戏是gameboy最喜欢的游戏之一。游戏的规则是这样的:计算机随机产生一个四位数,然后玩家猜这个四位数是什么。每猜一个数,计算机都会告诉玩家猜对几个数字,其中有几个数字在正确的位置上。比如计算机随机产生的数字为1122。如果玩家猜1234,因为1,2这 阅读全文
posted @ 2019-07-21 17:11 _Ackerman 阅读(510) 评论(0) 推荐(0) 编辑
摘要: Suppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a street or a 阅读全文
posted @ 2019-07-21 16:24 _Ackerman 阅读(245) 评论(0) 推荐(0) 编辑
摘要: Problem Description A robot has been programmed to follow the instructions in its path. Instructions for the next direction the robot is to move are l 阅读全文
posted @ 2019-07-21 14:31 _Ackerman 阅读(324) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/1185/C1 题目大意: 有n个学生排队依次进行考试(一次只能有一名同学进行考试,俺也不知道为啥,俺也不敢问),考试时间共计m,每个考生考试需要若干时间,考试时间结束后,没有时间考试的同学就不能考了。输入分 阅读全文
posted @ 2019-07-21 14:06 _Ackerman 阅读(278) 评论(0) 推荐(0) 编辑
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 37 下一页