Sum vs Product Time Limit: 2000/1000MS (Java/Others)    Memory Limit: 128000/64000KB (Java/Others) Submit Status Problem Description Peter has just learned mathematics. He learned how to add, and how to multiply. The fact that 2 + 2 = 2 × 2 has amaze…
Sum vs Product Time Limit: 4000/2000MS (Java/Others)Memory Limit: 128000/64000KB (Java/Others) SubmitStatisticNext Problem Problem Description Peter has just learned mathematics. He learned how to add, and how to multiply. The fact that 2 + 2 = 2 × 2…
                                                                                                               Sum It Up Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 5820   Accepted: 2970 Description Given a specified total t and a…
Sum It Up Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 4   Accepted Submission(s) : 1 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description Given a specified total t and…
Sticks Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9779    Accepted Submission(s): 2907 Problem Description George took sticks of the same length and cut them randomly until all parts became…
题目传送门 /* 题意:若干小木棍,是由多条相同长度的长木棍分割而成,问最小的原来长木棍的长度: DFS剪枝:剪枝搜索的好题!TLE好几次,终于剪枝完全! 剪枝主要在4和5:4 相同长度的木棍不再搜索:5 若新的搜索连第一条都没组合出来,直接break: 详细解释:http://blog.csdn.net/lyy289065406/article/details/6647960 http://www.cnblogs.com/devil-91/archive/2012/08/03/2621787.…
题目链接 Solution DFS+剪枝 对于一个走过点k,如果有必要再走一次,那么一定是走过k后在k点的最大弹药数增加了.否则一定没有必要再走. 记录经过每个点的最大弹药数,对dfs进行剪枝. #include <iostream> #include <cstring> #include <algorithm> #include <cstdio> #include <map> using namespace std; map<string…
Sticks Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 127771   Accepted: 29926 Description George took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the or…
题目链接: http://acm.nyist.net/JudgeOnline/problem.php?pid=1249 描述 某地区发生了地震,灾区已经非常困难,灾民急需一些帐篷.衣物.食品和血浆等物资.可通往灾区的道路到处都是塌方,70%以上的路面损坏,桥梁全部被毁.国家立即启动应急预案,展开史上最大强度非作战空运行动,准备向灾区空投急需物资. 一方有难,八方支援.现在已知有N个地方分别有A1,A2,-.,An个物资可供调配.目前灾区需要物资数量为M. 现在,请你帮忙算一算,总共有多少种物质调…
将木棒从大到小排列,保证每次的选择都是最长可选的木棒. 剪枝: 1 . 如果第 i 根木棒被选择却无法成功拼接,那么后面与其长度相同的也不能选择. 2 . 如果第 cnt + 1 根木棒无法成功拼接,就应该立即重构第 cnt 根木棒.那么如何判断是否能构造木棍呢?每次可以选择的最长木棒必须要选择,因为就算这次不选择,后面木棒的拼接也要用到该木棒,如果不能利用该木棍直接返回构造上一根木棍. 3 . 如果现在加入长度为x的一节木棒刚好组成一节完整的木棒,但是后面的木棍不能成功拼接,就重新选取上一节木…