摘要: K Sum 题目描述 给定一个输入数组 array(每个数不同),还有两个整数 k 和 target,在数组 array 中找出 k 个元素,使得这 k 个元素相加等于 target,问有多少种组合方式,输出组合方式的个数。 注:在一种组合方式中,一个元素不能够被重复选择 这里就说明了要用01背包的 阅读全文
posted @ 2020-03-30 23:46 种树人 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 给定硬币面额和种类,给定总金额,求用最少个数的硬币去组成这个金额 https://leetcode cn.com/problems/coin change 和leetcode 518 类似 Example 1: Input: coins = [1, 2, 5], amount = 11 Output 阅读全文
posted @ 2020-03-30 17:52 种树人 阅读(197) 评论(0) 推荐(0) 编辑
摘要: [集合能不能分成2个相等的子集] https://leetcode cn.com/problems/partition equal subset sum Note: Each of the array element will not exceed 100. The array size will 阅读全文
posted @ 2020-03-30 16:34 种树人 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 给定硬币面额和种类,给定总金额,问有多少种组合方法; https://leetcode cn.com/problems/coin change 2/ Example 1: Input: amount = 5, coins = [1, 2, 5] Output: 4 Explanation: ther 阅读全文
posted @ 2020-03-30 16:10 种树人 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 来自某人博客,失效了去github看 github 看不懂 Floyd算法又称为插点法,是一种利用动态规划的思想寻找给定的加权图中多源点之间最短路径的算法,与Dijkstra算法类似。该算法名称以创始人之一、1978年图灵奖获得者、斯坦福大学计算机科学系教授罗伯特·弗洛伊德命名。从图的带权邻接矩阵A 阅读全文
posted @ 2020-03-30 14:53 种树人 阅读(597) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/anlian523/article/details/80955066 阅读全文
posted @ 2020-03-30 14:37 种树人 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 小兔的棋盘 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 10271 Accepted Submission(s): 5269 https:/ 阅读全文
posted @ 2020-03-30 14:18 种树人 阅读(282) 评论(0) 推荐(0) 编辑