上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 59 下一页
摘要: 题目描述 X星球的考古学家发现了一批古代留下来的密码。这些密码是由A、B、C、D 四种植物的种子串成的序列。 仔细分析发现,这些密码串当初应该是前后对称的(也就是我们说的镜像串)。 由于年代久远,其中许多种子脱落了,因而可能会失去镜像的特征。 你的任务是:给定一个现在看到的密码串,计算一下从当初的状 阅读全文
posted @ 2020-02-14 13:10 知道了呀~ 阅读(384) 评论(0) 推荐(0)
摘要: 首先区分子序列和子串,序列不要求连续性(连续和不连续都可以),但子串一定是连续的 1.最长公共子序列 1、最长公共子序列问题有最优子结构,这个问题可以分解称为更小的问题 2、同时,子问题的解释可以被重复使用的,也就是说更高级别的子问题会重用更小子问题的解。 满足这两点以后,很容易就想到用动态规划来求 阅读全文
posted @ 2020-02-14 12:56 知道了呀~ 阅读(324) 评论(0) 推荐(0)
摘要: 题目描述 现在小学的数学题目也不是那么好玩的。 看看这个寒假作业: 每个方块代表1~13中的某一个数字,但不能重复。 比如: 6 + 7 = 13 9 - 8 = 1 3 * 4 = 12 10 / 2 = 5 以及: 7 + 6 = 13 9 - 8 = 1 3 * 4 = 12 10 / 2 = 阅读全文
posted @ 2020-02-13 21:32 知道了呀~ 阅读(311) 评论(0) 推荐(0)
摘要: 题目描述 X星的坦克战车很奇怪,它必须交替地穿越正能量辐射区和负能量辐射区才能保持正常运转,否则将报废。 某坦克需要从A区到B区去(A,B区本身是安全区,没有正能量或负能量特征),怎样走才能路径最短? 已知的地图是一个方阵,上面用字母标出了A,B区,其它区都标了正号或负号分别表示正负能量辐射区。 例 阅读全文
posted @ 2020-02-13 20:50 知道了呀~ 阅读(338) 评论(0) 推荐(0)
摘要: 答案:416 用next_permutation()全部排列的话会超时 所以用dfs搜索,只搜索前三行就好,前三行确定之后,第四行也就确定 #include<iostream> #include<string> #include<string.h> #include<algorithm> using 阅读全文
posted @ 2020-02-12 18:45 知道了呀~ 阅读(364) 评论(0) 推荐(0)
摘要: 1014 Waiting in Line (30分) Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting are 阅读全文
posted @ 2020-01-09 17:12 知道了呀~ 阅读(478) 评论(0) 推荐(0)
摘要: 1013 Battle Over Cities (25分) It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all t 阅读全文
posted @ 2020-01-04 20:53 知道了呀~ 阅读(352) 评论(0) 推荐(0)
摘要: 1012 The Best Rank (25分) To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Prog 阅读全文
posted @ 2020-01-03 19:51 知道了呀~ 阅读(348) 评论(0) 推荐(0)
摘要: 1009 Product of Polynomials (25分) This time, you are supposed to find A×B where A and B are two polynomials. Input Specification: Each input file cont 阅读全文
posted @ 2019-12-31 10:12 知道了呀~ 阅读(405) 评论(0) 推荐(0)
摘要: 1007 Maximum Subsequence Sum (25分) Given a sequence of K integers { N​1​​, N​2​​, ..., N​K​​ }. A continuous subsequence is defined to be { N​i​​, N​i 阅读全文
posted @ 2019-12-26 17:21 知道了呀~ 阅读(747) 评论(0) 推荐(1)
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 59 下一页