博客园 - 彩虹色uuid:24b78886-0ed1-41c2-8670-e3f31dcf42c4;id=32292019-05-29T07:13:23Z彩虹色https://www.cnblogs.com/hdyss/feed.cnblogs.comhttps://www.cnblogs.com/hdyss/p/10853563.htmlhdoj - 1864 最大报销额 - 彩虹色Problem Description 现有一笔经费可以报销一定额度的发票。允许报销的发票类型包括买图书(A类)、文具(B类)、差旅(C类),要求每张发票的总额不得超过1000元,每张发票上,单项物品的价值不得超过600元。现请你编写程序,在给出的一堆发票中找出可以报销的、不超过给定额度的最大报销额2019-05-12T12:35:00Z2019-05-12T12:35:00Z彩虹色https://www.cnblogs.com/hdyss/【摘要】Problem Description 现有一笔经费可以报销一定额度的发票。允许报销的发票类型包括买图书(A类)、文具(B类)、差旅(C类),要求每张发票的总额不得超过1000元,每张发票上,单项物品的价值不得超过600元。现请你编写程序,在给出的一堆发票中找出可以报销的、不超过给定额度的最大报销额 <a href="https://www.cnblogs.com/hdyss/p/10853563.html" target="_blank">阅读全文</a>https://www.cnblogs.com/hdyss/p/10853303.htmlhdoj - 1506 直方图中最大的矩形 - 彩虹色Problem Description A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but 2019-05-12T11:21:00Z2019-05-12T11:21:00Z彩虹色https://www.cnblogs.com/hdyss/【摘要】Problem Description A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but <a href="https://www.cnblogs.com/hdyss/p/10853303.html" target="_blank">阅读全文</a>https://www.cnblogs.com/hdyss/p/10838673.htmlQHUOJ - 1533: 计算组合数(大数计算) - 彩虹色题目描述 给定两个正整数n,m,计算组合数C(n,m)。组合数计算公式为:C(n,m)=n!/((n-m)!*m!) 已知n,m <= 50. 结果很大需要使用long long存储。 给定两个正整数n,m,计算组合数C(n,m)。组合数计算公式为:C(n,m)=n!/((n-m)!*m!) 已知n2019-05-09T07:22:00Z2019-05-09T07:22:00Z彩虹色https://www.cnblogs.com/hdyss/【摘要】题目描述 给定两个正整数n,m,计算组合数C(n,m)。组合数计算公式为:C(n,m)=n!/((n-m)!*m!) 已知n,m <= 50. 结果很大需要使用long long存储。 给定两个正整数n,m,计算组合数C(n,m)。组合数计算公式为:C(n,m)=n!/((n-m)!*m!) 已知n <a href="https://www.cnblogs.com/hdyss/p/10838673.html" target="_blank">阅读全文</a>https://www.cnblogs.com/hdyss/p/10820486.htmlhdoj - 2602 Bone Collector - 彩虹色Problem Description Many years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , s2019-05-06T08:37:00Z2019-05-06T08:37:00Z彩虹色https://www.cnblogs.com/hdyss/【摘要】Problem Description Many years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , s <a href="https://www.cnblogs.com/hdyss/p/10820486.html" target="_blank">阅读全文</a>https://www.cnblogs.com/hdyss/p/10820272.htmlhdoj - 1248 寒冰王座 - 彩虹色Problem Description 不死族的巫妖王发工资拉,死亡骑士拿到一张N元的钞票(记住,只有一张钞票),为了防止自己在战斗中频繁的死掉,他决定给自己买一些道具,于是他来到了地精商店前.死亡骑士:"我要买道具!"地精商人:"我们这里有三种道具,血瓶150块一个,魔法药200块一个,无敌药水32019-05-06T08:12:00Z2019-05-06T08:12:00Z彩虹色https://www.cnblogs.com/hdyss/【摘要】Problem Description 不死族的巫妖王发工资拉,死亡骑士拿到一张N元的钞票(记住,只有一张钞票),为了防止自己在战斗中频繁的死掉,他决定给自己买一些道具,于是他来到了地精商店前.死亡骑士:"我要买道具!"地精商人:"我们这里有三种道具,血瓶150块一个,魔法药200块一个,无敌药水3 <a href="https://www.cnblogs.com/hdyss/p/10820272.html" target="_blank">阅读全文</a>https://www.cnblogs.com/hdyss/p/10819890.htmlhdoj - 2546 饭卡 - 彩虹色Problem Description 电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。某天,食堂中有n种菜出售,每种菜2019-05-06T07:31:00Z2019-05-06T07:31:00Z彩虹色https://www.cnblogs.com/hdyss/【摘要】Problem Description 电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。某天,食堂中有n种菜出售,每种菜 <a href="https://www.cnblogs.com/hdyss/p/10819890.html" target="_blank">阅读全文</a>https://www.cnblogs.com/hdyss/p/10815541.htmlhdoj - 1181 变形课 - 彩虹色Problem Description 呃......变形课上Harry碰到了一点小麻烦,因为他并不像Hermione那样能够记住所有的咒语而随意的将一个棒球变成刺猬什么的,但是他发现了变形咒语的一个统一规律:如果咒语是以a开头b结尾的一个单词,那么它的作用就恰好是使A物体变成B物体. Harry已2019-05-05T10:55:00Z2019-05-05T10:55:00Z彩虹色https://www.cnblogs.com/hdyss/【摘要】Problem Description 呃......变形课上Harry碰到了一点小麻烦,因为他并不像Hermione那样能够记住所有的咒语而随意的将一个棒球变成刺猬什么的,但是他发现了变形咒语的一个统一规律:如果咒语是以a开头b结尾的一个单词,那么它的作用就恰好是使A物体变成B物体. Harry已 <a href="https://www.cnblogs.com/hdyss/p/10815541.html" target="_blank">阅读全文</a>https://www.cnblogs.com/hdyss/p/10809892.htmlhdoj - 1241 Oil Deposits - 彩虹色Problem Description The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large re2019-05-04T13:22:00Z2019-05-04T13:22:00Z彩虹色https://www.cnblogs.com/hdyss/【摘要】Problem Description The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large re <a href="https://www.cnblogs.com/hdyss/p/10809892.html" target="_blank">阅读全文</a>https://www.cnblogs.com/hdyss/p/10809725.htmlhdoj - 1016 Prime Ring Problem - 彩虹色A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacen2019-05-04T12:45:00Z2019-05-04T12:45:00Z彩虹色https://www.cnblogs.com/hdyss/【摘要】A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacen <a href="https://www.cnblogs.com/hdyss/p/10809725.html" target="_blank">阅读全文</a>https://www.cnblogs.com/hdyss/p/10809310.htmlhdoj - 1342 Lotto - 彩虹色Problem Description In a Lotto I have ever played, one has to select 6 numbers from the set {1,2,...,49}. A popular strategy to play Lotto - although 2019-05-04T10:34:00Z2019-05-04T10:34:00Z彩虹色https://www.cnblogs.com/hdyss/【摘要】Problem Description In a Lotto I have ever played, one has to select 6 numbers from the set {1,2,...,49}. A popular strategy to play Lotto - although <a href="https://www.cnblogs.com/hdyss/p/10809310.html" target="_blank">阅读全文</a>https://www.cnblogs.com/hdyss/p/10808776.htmlhdoj - 1258 Sum It Up - 彩虹色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 examp2019-05-04T08:12:00Z2019-05-04T08:12:00Z彩虹色https://www.cnblogs.com/hdyss/【摘要】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 <a href="https://www.cnblogs.com/hdyss/p/10808776.html" target="_blank">阅读全文</a>https://www.cnblogs.com/hdyss/p/10803391.htmlleetcode 467. 环绕字符串中唯一的子字符串 - 彩虹色题目描述: 把字符串 s 看作是“abcdefghijklmnopqrstuvwxyz”的无限环绕字符串,所以 s 看起来是这样的:"...zabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd....". 现在我们有了另一个字符串 p 。2019-05-02T13:07:00Z2019-05-02T13:07:00Z彩虹色https://www.cnblogs.com/hdyss/【摘要】题目描述: 把字符串 s 看作是“abcdefghijklmnopqrstuvwxyz”的无限环绕字符串,所以 s 看起来是这样的:"...zabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd....". 现在我们有了另一个字符串 p 。 <a href="https://www.cnblogs.com/hdyss/p/10803391.html" target="_blank">阅读全文</a>https://www.cnblogs.com/hdyss/p/10802860.htmlleetcode 61. 旋转链表 - 彩虹色题目描述: 给定一个链表,旋转链表,将链表每个节点向右移动 k 个位置,其中 k 是非负数。 示例 1: 示例 2:2019-05-02T09:48:00Z2019-05-02T09:48:00Z彩虹色https://www.cnblogs.com/hdyss/【摘要】题目描述: 给定一个链表,旋转链表,将链表每个节点向右移动 k 个位置,其中 k 是非负数。 示例 1: 示例 2: <a href="https://www.cnblogs.com/hdyss/p/10802860.html" target="_blank">阅读全文</a>https://www.cnblogs.com/hdyss/p/10802570.htmlhdoj -1312 Red and Black - 彩虹色Problem Description There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black til2019-05-02T08:15:00Z2019-05-02T08:15:00Z彩虹色https://www.cnblogs.com/hdyss/【摘要】Problem Description There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black til <a href="https://www.cnblogs.com/hdyss/p/10802570.html" target="_blank">阅读全文</a>https://www.cnblogs.com/hdyss/p/10802550.htmlhdoj 1010-Tempter of the Bone - 彩虹色Problem Description The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, an2019-05-02T08:07:00Z2019-05-02T08:07:00Z彩虹色https://www.cnblogs.com/hdyss/【摘要】Problem Description The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, an <a href="https://www.cnblogs.com/hdyss/p/10802550.html" target="_blank">阅读全文</a>https://www.cnblogs.com/hdyss/p/10800882.htmlleetcode 91. 解码方法 - 彩虹色题目描述: 一条包含字母 A-Z 的消息通过以下方式进行了编码: 给定一个只包含数字的非空字符串,请计算解码方法的总数。 示例 1: 示例 2: 题目链接:https://leetcode-cn.com/problems/decode-ways/2019-05-01T13:43:00Z2019-05-01T13:43:00Z彩虹色https://www.cnblogs.com/hdyss/【摘要】题目描述: 一条包含字母 A-Z 的消息通过以下方式进行了编码: 给定一个只包含数字的非空字符串,请计算解码方法的总数。 示例 1: 示例 2: 题目链接:https://leetcode-cn.com/problems/decode-ways/ <a href="https://www.cnblogs.com/hdyss/p/10800882.html" target="_blank">阅读全文</a>https://www.cnblogs.com/hdyss/p/10800653.htmlleetcode 925. 长按键入 - 彩虹色题目描述: 你的朋友正在使用键盘输入他的名字 name。偶尔,在键入字符 c 时,按键可能会被长按,而字符可能被输入 1 次或多次。 你将会检查键盘输入的字符 typed。如果它对应的可能是你的朋友的名字(其中一些字符可能被长按),那么就返回 True。 示例 1: 示例 2: 示例 3: 示例 42019-05-01T12:22:00Z2019-05-01T12:22:00Z彩虹色https://www.cnblogs.com/hdyss/【摘要】题目描述: 你的朋友正在使用键盘输入他的名字 name。偶尔,在键入字符 c 时,按键可能会被长按,而字符可能被输入 1 次或多次。 你将会检查键盘输入的字符 typed。如果它对应的可能是你的朋友的名字(其中一些字符可能被长按),那么就返回 True。 示例 1: 示例 2: 示例 3: 示例 4 <a href="https://www.cnblogs.com/hdyss/p/10800653.html" target="_blank">阅读全文</a>https://www.cnblogs.com/hdyss/p/10800484.htmlleetcode 437. 路径总和 III - 彩虹色题目描述: 给定一个二叉树,它的每个结点都存放着一个整数值。 找出路径和等于给定数值的路径总数。 路径不需要从根节点开始,也不需要在叶子节点结束,但是路径方向必须是向下的(只能从父节点到子节点)。 二叉树不超过1000个节点,且节点数值范围是 [-1000000,1000000] 的整数。 示例: 2019-05-01T11:15:00Z2019-05-01T11:15:00Z彩虹色https://www.cnblogs.com/hdyss/【摘要】题目描述: 给定一个二叉树,它的每个结点都存放着一个整数值。 找出路径和等于给定数值的路径总数。 路径不需要从根节点开始,也不需要在叶子节点结束,但是路径方向必须是向下的(只能从父节点到子节点)。 二叉树不超过1000个节点,且节点数值范围是 [-1000000,1000000] 的整数。 示例: <a href="https://www.cnblogs.com/hdyss/p/10800484.html" target="_blank">阅读全文</a>https://www.cnblogs.com/hdyss/p/10800162.htmlleetcode 892. 三维形体的表面积 - 彩虹色题目描述: 在 N * N 的网格上,我们放置一些 1 * 1 * 1 的立方体。 每个值 v = grid[i][j] 表示 v 个正方体叠放在单元格 (i, j) 上。 返回最终形体的表面积。 示例 1: 示例 2: 示例 3: 示例 4: 示例 5: 如上图:输入为:【【2,1】,【1,0】】2019-05-01T08:57:00Z2019-05-01T08:57:00Z彩虹色https://www.cnblogs.com/hdyss/【摘要】题目描述: 在 N * N 的网格上,我们放置一些 1 * 1 * 1 的立方体。 每个值 v = grid[i][j] 表示 v 个正方体叠放在单元格 (i, j) 上。 返回最终形体的表面积。 示例 1: 示例 2: 示例 3: 示例 4: 示例 5: 如上图:输入为:【【2,1】,【1,0】】 <a href="https://www.cnblogs.com/hdyss/p/10800162.html" target="_blank">阅读全文</a>https://www.cnblogs.com/hdyss/p/10795511.html二分查找 - 彩虹色题目描述 对于一个有序数组,我们通常采用二分查找的方式来定位某一元素,请编写二分查找的算法,在数组中查找指定元素。 给定一个整数数组A及它的大小n,同时给定要查找的元素val,请返回它在数组中的位置(从0开始),若不存在该元素,返回-1。若该元素出现多次,请返回第一次出现的位置。 测试样例: [1,2019-04-30T05:33:00Z2019-04-30T05:33:00Z彩虹色https://www.cnblogs.com/hdyss/【摘要】题目描述 对于一个有序数组,我们通常采用二分查找的方式来定位某一元素,请编写二分查找的算法,在数组中查找指定元素。 给定一个整数数组A及它的大小n,同时给定要查找的元素val,请返回它在数组中的位置(从0开始),若不存在该元素,返回-1。若该元素出现多次,请返回第一次出现的位置。 测试样例: [1, <a href="https://www.cnblogs.com/hdyss/p/10795511.html" target="_blank">阅读全文</a>