深度优先搜索
ZZ --瑞 hopeACMer
WA就完事了
展开
-
生日蛋糕
生日蛋糕POJ 1190 生日蛋糕 【DFS + 极限剪枝】题目传送门:http://poj.org/problem?id=1190参考剪枝:https://blog.csdn.net/nvfumayx/article/details/6653111生日蛋糕Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 23038...转载 2019-01-23 08:32:33 · 427 阅读 · 1 评论 -
3303——鬼吹灯之牧野诡事(图的遍历)
鬼吹灯之湘西疑陵 Time Limit: 1000 ms Memory Limit: 65536 KiB Submit Statistic Problem Description 现有n种商品,每种商品有Si件,每种商品的价格和质量分别为Pi和Mi。你现在有钱V,问能购买的商品的总质量最大为多少。 Inp...转载 2019-01-28 20:54:32 · 389 阅读 · 0 评论 -
有一颗数,树的边权为1,树上的有些节点有大学,现在要把这些大学配对,每对大学之间都要链接线缆,问最多要链接多长的线缆。
Treeland is a country in which there are n towns connected by n - 1 two-way road such that it’s possible to get from any town to any other town.In Treeland there are 2k universities which are located...原创 2019-02-03 21:17:59 · 368 阅读 · 0 评论 -
F
Roman planted a tree consisting of n vertices. Each vertex contains a lowercase English letter. Vertex 1 is the root of the tree, each of the n - 1 remaining vertices has a parent in the tree. Vertex ...原创 2019-02-03 21:24:23 · 168 阅读 · 0 评论 -
C - Sum It Up HDU - 1258
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 example, if t=4, n=6, and the list is [4,3,2,2,1,1], then there are four d...原创 2019-02-21 08:06:57 · 96 阅读 · 0 评论