
动态规划
文章平均质量分 82
寒山小妖
你被别人嫉妒说明你卓越,你嫉妒别人说明你无能。
展开
-
部分和问题
部分和问题题目:给定整数a1,a2,...,an,判断是否可以从中选出若干个数,使他们的和恰好为k。限定条件:1输入:41 2 4 71341 2 4 715输出:YesNo//解法一:这段代码是我根据01背包的思想做的,我把问题看成是容量为k的背包,有n件体积和价值都为a[i]的物品,求出背包能装的最大价值,如果最大价值正好等于背包容量,也就是原创 2016-09-05 13:52:48 · 494 阅读 · 0 评论 -
Common Subsequence(LCS最长公共子序列)
Common SubsequenceTime Limit:1000MS Memory Limit:10000KB 64bit IO Format:%lld & %lluDescriptionA subsequence of a given sequence is the given sequence with some elements (possible原创 2016-08-07 23:20:54 · 425 阅读 · 2 评论 -
免费馅饼(数塔)
免费馅饼Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 12017 Accepted Submission(s): 3997Description 都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉原创 2016-08-07 22:26:49 · 457 阅读 · 3 评论 -
Charm Bracelet(01背包)
Charm BraceletTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluDescriptionBessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd原创 2016-08-07 19:29:05 · 417 阅读 · 5 评论 -
The Triangle(数塔)
The TriangleTime Limit:1000MS Memory Limit:10000KB 64bit IO Format:%lld & %lluDescription7 3 8 8 1 0 2 7 4 44 5 2 6 5(Figure 1)Figure 1 s原创 2016-08-02 15:21:01 · 355 阅读 · 0 评论 -
Filthy Rich(数塔)
Filthy RichProblem DescriptionThey say that in Phrygia, the streets are paved with gold. You’re currently on vacation in Phrygia, and to your astonishment you discover that this is to be taken原创 2016-07-17 14:31:21 · 556 阅读 · 0 评论