1 2 //坐标精度是int 3 /* 4 圆心位于 5 */ 6 #include <iostream> 7 #include <cstdlib> 8 #include <cstring> 9 #include <cmath>10 using namespace std; 11 12 const int N = 1005;13 typedef struct Part 14 {15 int a, b;16 };17 Part q[N];18 19 typedef struct Node 20 {21 int left, right;22 };23
转载
2013-04-13 23:22:00
57阅读
2评论
#include<iostream> #include<cmath> #include<algorithm> using namespace std; int main(){ int n,d,kase=1,r; double p[1005][2],island[1005][2]; while(cin ...
转载
2021-07-27 20:28:00
179阅读
2评论
#include #include #include struct location { double x; double y; bool processed;};struct locationValidXRange { double begin; double end;};bool locationCanR
原创
2023-05-23 15:58:03
30阅读
贪心,区间排序如果区间包含 略过,否则答案+1;Program P1328;var n,d,i,j,k,ans:longint; x:double; tag:boolean; map:array[1..1000,1..2] of double;procedure qsort(l,r:longint);var i,j:longint;
原创
2012-08-16 22:11:26
61阅读
Radar InstallationTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 51377Accepted: 11527 思路 : 每一个岛都在X轴上有一个区间能够被雷达覆盖,x1
转载
2015-02-26 09:46:00
96阅读
2评论
#include <iostream>#include <math.h>#include<algorithm>using namespace std;struct seg { double left;double right; bool operator<(const seg& a)const { return left<a.left; }}range[1001];int main(){ int n,d,i,t=1;double x,y;bool tag; while(cin>>n>>d) { if(n==0&am
转载
2011-07-18 11:18:00
104阅读
2评论
点击打
原创
2022-06-15 21:52:51
155阅读
把每个岛转换成区间。然后对区间排序。选择区间最右点为站点。最初一直wrong,是因为我排序的方式不对。应该按最后点排序。而不是区间的第一个点。#include#include#include#include#include#includeusing namespace std;pair p[10000+10];bool cmp(const pair &p1,const
原创
2022-08-05 16:00:05
16阅读
一、内容假定海岸线是无限长的直线。陆地位于海岸线的一侧,海洋位于另一侧。每个小岛是位于海洋中的一个点。对于任何一个雷达的安装 (均位于海岸线上),只能覆盖 d 距离,因此海洋中的小岛被雷达安装所覆盖的条件是两者间的距离不超过 d 。我们使用卡笛尔坐标系,将海岸线定义为 x 轴。海洋的一侧位于 x 轴上方,陆地的一侧位于下方。给定海洋中每个小岛的位置,并给定雷达安装的覆盖距离,您的任务是写一个...
原创
2022-02-03 10:03:09
187阅读
Radar InstallationTime Limit: 1000MS Memory Limit: 10000KTotal Sg is an infinite straight line. Land
原创
2022-11-18 16:11:12
61阅读
因为雷达必须要建立在x轴上 所以当y>d则...
转载
2016-07-23 15:41:00
108阅读
题意:假设海岸线是一条无限延伸的直线。陆地在海岸线的一侧,而海洋在另一侧。每一个小的岛屿是海洋上的一个点。雷达坐落于海岸线上,只能覆盖d距离,所以如果小岛能够被覆盖到的话,它们之间的距离最多为d。 题目要求计算出能够覆盖给出的所有岛屿的最少雷达数目。 /* 对于每个小岛,按照横坐标从小到大排序,并且
转载
2016-07-06 11:01:00
113阅读
2评论
#include
#include
#include
using namespace std;
int n,d,ans;
struct point
{ int x,y;
}p[1010];
bool operator temp) t=temp; else if(p[i].y*p[i].y+(t-p[i].x)*(t-p[i].x)>n>>d && (n||d)) {ok=1; for(i=0;i>p[i].x>>p[i].y; if(p[i].y>d) ok=0; } ...
转载
2013-05-18 19:41:00
39阅读
2评论
Description Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating
转载
2017-09-09 15:32:00
46阅读
2评论
【题目链接】 http://poj.org/problem?id=1328 【算法】 每个雷达都位于笛卡尔坐标系的x轴上,因此,对于每个岛屿,我们都可以用勾股定理算出它的有效管辖区域 那么,问题就被转化成了 : 给定若干个区间,要求每个区间内都要有一个点,最小化点的个数 我们将这些区间按左端点排序,
转载
2018-06-28 14:13:00
162阅读
2评论
一、内容假定海岸线是无限长的直线。陆地位于海岸线的一侧,海洋位于另一侧。每个小岛是位于海洋中的一个点。对于任何一个雷达的安装 (均位于海岸线上),只能覆盖 d 距离,因此海洋中的小岛被雷达安装所覆盖的条件是两者间的距离不超过 d 。我们使用卡笛尔坐标系,将海岸线定义为 x 轴。海洋的一侧位于 x 轴上方,陆地的一侧位于下方。给定海洋中每个小岛的位置,并给定雷达安装的覆盖距离,您的任务是写一个...
原创
2021-08-27 14:23:41
228阅读
Radar Installation
Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u
Description
Assume the coasting is an infinite straight line. Land is in one side of coasti
转载
2021-08-30 14:26:31
76阅读
Radar Installation
Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u
Submit Status Practice POJ 1328
Appoint description: System Crawler (2015-04-04)
Description
原创
2021-08-31 10:21:12
177阅读
Description Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating
转载
2017-03-09 16:25:00
33阅读
2评论
DescriptionAssume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating ...
转载
2015-12-18 17:05:00
27阅读