Saruman's Army(贪心)】的更多相关文章

带来两题贪心算法的题. 1.给定长度为N的字符串S,要构造一个长度为N的字符串T.起初,T是一个空串,随后反复进行下面两个操作:1.从S的头部删除一个字符,加到T的尾部.2.从S的尾部删除一个字符,加到T的尾部.求你任意采取这两个步骤后能得到的最小字符串T 2.直线上有N个点,点i的位置是xi,这N个点中选择若干个做上标记,对于每个点,在他们距离为R的区域内必须带有标记点,求在满足这个条件的情况下,所需要标记点的最少个数. 1.POJ 3617 Best Cow Line http://poj.…
 Saruman's Army Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Submit Status Practice POJ 3069 Appoint description:  System Crawler  (2015-04-27) Description Saruman the White must lead his army along a straight path fro…
Saruman's Army Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 18794   Accepted: 9222 Description Saruman the White must lead his army along a straight path from Isengard to Helm’s Deep. To keep track of his forces, Saruman distributes s…
在一条直线上,有n个点.从这n个点中选择若干个,给他们加上标记.对于每一个点,其距离为R以内的区域里必须有一个被标记的点.问至少要有多少点被加上标记 Saruman the White must lead his army along a straight path from Isengard to Helm's Deep. To keep track of his forces, Saruman distributes seeing stones, known as palantirs, am…
地址 http://poj.org/problem?id=3069 题解 题目可以考虑贪心 尽可能的根据题意选择靠右边的点 注意 开始无标记点 寻找左侧第一个没覆盖的点 再来推算既可能靠右的标记点为一轮 我最开始就是轮次的操作理解错误 结果wa了 ac代码如下 #include <iostream> #include <vector> #include <algorithm> using namespace std; /* poj3069 题目大意:一个直线上有N个点.…
Saruman the White must lead his army along a straight path from Isengard to Helm’s Deep. To keep track of his forces, Saruman distributes seeing stones, known as palantirs, among the troops. Each palantir has a maximum effective range of R units, and…
Saruman's Army Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 131072/65536K (Java/Other) Total Submission(s) : 3   Accepted Submission(s) : 2 Problem Description Saruman the White must lead his army along a straight path from Isengard to Helm…
Saruman the White must lead his army along a straight path from Isengard to Helm's Deep. To keep track of his forces, Saruman distributes seeing stones, known as palantirs, among the troops. Each palantir has a maximum effective range of R units, and…
Saruman's Army Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8477   Accepted: 4317 Description Saruman the White must lead his army along a straight path from Isengard to Helm’s Deep. To keep track of his forces, Saruman distributes se…
http://poj.org/problem?id=3069 Saruman the White must lead his army along a straight path from Isengard to Helm’s Deep. To keep track of his forces, Saruman distributes seeing stones, known as palantirs, among the troops. Each palantir has a maximum…