POJ 3069 Saruman's Army (模拟)】的更多相关文章

POJ 3069 Saruman's Army(萨鲁曼军) Time Limit: 1000MS   Memory Limit: 65536K [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 seeing stones, know…
带来两题贪心算法的题. 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.…
题目连接 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 seeing stones, known as palantirs, among the troops. Each palantir has a maximum effective rang…
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…
 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: 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…
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…
链接:http://poj.org/problem?id=3069 题解 #include<iostream> #include<algorithm> using namespace std; ; int N,R; // N是部队数,R是有效射程 int X[MAX]; void solve(){ sort(X,X+N); ,ans=; while(i<N){ // s是没有被覆盖的最左边的点的位置 int s=X[i++]; //一直向右前进直到距 s的距离大于 R的点,此…
地址 http://poj.org/problem?id=3069 题解 题目可以考虑贪心 尽可能的根据题意选择靠右边的点 注意 开始无标记点 寻找左侧第一个没覆盖的点 再来推算既可能靠右的标记点为一轮 我最开始就是轮次的操作理解错误 结果wa了 ac代码如下 #include <iostream> #include <vector> #include <algorithm> using namespace std; /* poj3069 题目大意:一个直线上有N个点.…
简单贪心. 从左边开始,找 r 以内最大距离的点,再在该点的右侧找到该点能覆盖的点.如图. 自己的逻辑有些混乱,最后还是参考书上代码.(<挑战程序设计> P46) /****************************************** Problem: 3069 User: Memory: 668K Time: 16MS Language: G++ Result: Accepted ******************************************/ #inc…