11729专题

UVA 11729突击战(贪心)

思路:要时间最短,即要求尽量多的任务同时进行,则把执行时间由大到小排序即可。 #include <iostream>#include <map>#include <deque>#include <queue>#include <stack>#include <string>#include <cstring>#include <cstdio>#include <cmath>#i

uva 11729 - Commando War(贪心)

题目链接:uva 11729 - Commando War 题目大意:有n个人要去执行任务,第i个人交代任务的时间为Bi,了解完任务之后会不间断的执行Ji分钟,完成所有任务的最短时间。 解题思路:将完成任务需要时间叫长的最先交代,所以只要排序一次然后计算最大时间就可以了。 证明:对于连续的两个人x和y,可以分两种情况: 1.J[x] > B[y] + J[y]时,x先的话,ti

UVa 11729 Commando War (贪心)

11729 - Commando War Time limit: 1.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=456&page=show_problem&problem=2829 “Waiting for orders we held in th

Commando War ,UVa 11729

【题目】 There is a war and it doesn’t look very promising for your country. Now it’s time to act. You have a commando squad at your disposal and planning an ambush on an important enemy camp located ne

UVa 11729 Commando War

链接: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2829 /*刘汝佳《训练指南》第一章 例题2UVa 11729 Commando War 贪心 , 用“相邻交换法”证明正确性------ by shuangde*/#include