![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
dp
文章平均质量分 79
哎-哭泣的鱼
这个作者很懒,什么都没留下…
展开
-
【九度】题目1025:最大报销额
题目描述: 现有一笔经费可以报销一定额度的发票。允许报销的发票类型包括买图书(A类)、文具(B类)、差旅(C类),要求每张发票的总额不得超过1000元,每张发票上,单项物品的价值不得超过600元。现请你编写程序,在给出的一堆发票中找出可以报销的、不超过给定额度的最大报销额。输入: 测试输入包含若干测试用例。每个测试用例的第1行包含两个正数 Q 和 N,其中 Q 是给定的报销原创 2014-02-12 17:04:31 · 963 阅读 · 0 评论 -
【九度】题目1547:出入栈
题目描述:给定一个初始为空的栈,和n个操作组成的操作序列,每个操作只可能是出栈或者入栈。要求在操作序列的执行过程中不会出现非法的操作,即不会在空栈时执行出栈操作,同时保证当操作序列完成后,栈恰好为一个空栈。求符合条件的操作序列种类。例如,4个操作组成的操作序列符合条件的如下:入栈,出栈,入栈,出栈入栈,入栈,出栈,出栈共2种。输入:输入包含多组测试用例,每组测试原创 2014-02-25 15:16:52 · 1628 阅读 · 5 评论 -
【LeetCode】Triangle
Triangle Total Accepted: 5496 Total Submissions: 21239 My SubmissionsGiven a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For原创 2014-02-11 16:11:52 · 698 阅读 · 0 评论 -
【LeetCode】Palindrome Partitioning I&II
原文来自http://blog.csdn.net/yutianzuijin/article/details/16850031leetcodeDP深搜回文串目录(?)[+]Palindrome PartitioningPalindrome Partitioning II深搜DP1 Palindrome Partitioning问题来源:Pa转载 2014-01-13 17:53:45 · 763 阅读 · 0 评论 -
【九度】题目1358:陈博的平均主义
题目1358:陈博的平均主义时间限制:1 秒内存限制:32 兆特殊判题:否提交:294解决:155题目描述:在JOBDU团队里,陈博是最讲平均主义的人了,但并不是像梁山好汉那样能够做到有钱同花,有肉同吃,毕竟,他还是被家里的领导管着的……陈博的平均主义,就只能体现在他对数字的喜好了。陈博特别喜欢一类“平均数”,“平均数”的具体定义为:对于一个数字,当其以十进制形式表示时,我们可以将原创 2014-06-09 16:59:43 · 745 阅读 · 0 评论 -
【LeetCode】Palindrome Partitioning II
Palindrome Partitioning II Total Accepted: 3698 Total Submissions: 21952 My SubmissionsGiven a string s, partition s such that every substring of the partition is a palindrome.Return the minimum c原创 2014-01-14 14:47:24 · 1006 阅读 · 0 评论 -
【九度】题目1422:Closest Number
题目1422:Closest Number时间限制:10 秒内存限制:64 兆特殊判题:否提交:690解决:136题目描述: There is one Master In ACM_DIY called "白衣少年"(White) whose motto is "I can HOLD ANY FEMALE". Since White is really busy with原创 2014-03-27 17:55:19 · 658 阅读 · 0 评论 -
【LeetCode】Interleaving String && CSDN 交替字符串
1、Interleaving StringTotal Accepted: 6431 Total Submissions: 34519 My SubmissionsGiven s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",原创 2014-03-29 14:54:31 · 1813 阅读 · 2 评论 -
【LeetCode】Distinct Subsequences
Distinct Subsequences Total Accepted: 6119 Total Submissions: 25615 My SubmissionsGiven a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string i原创 2014-03-18 15:24:42 · 1090 阅读 · 0 评论 -
【九度】题目1529:棋盘寻宝
题目1529:棋盘寻宝时间限制:1 秒内存限制:128 兆特殊判题:否提交:695解决:313题目描述:现在有一个8*8的棋盘,上面放着64个价值不等的礼物,每个小的棋盘上面放置一个礼物(礼物的价值大于0小于1000),一个人的初始位置在棋盘的左上角,每次他只能向下或向右移动一步,并拿走对应棋盘上的礼物,结束位置在棋盘的右下角,请设计一个算法使其能够获得最大价值的礼物。输入:输原创 2014-05-08 14:30:08 · 1072 阅读 · 0 评论 -
【LeetCode】357. Count Numbers with Unique Digits
357. Count Numbers with Unique Digits My Submissions QuestionEditorial SolutionTotal Accepted: 1190 Total Submissions: 2830 Difficulty: MediumGiven a non-negative integer n, count all numbers with原创 2016-06-14 14:19:59 · 838 阅读 · 0 评论