ZOJ1041 Transmitters】的更多相关文章

Transmitters Time Limit: 2 Seconds      Memory Limit: 65536 KB In a wireless network with multiple transmitters sending on the same frequencies, it is often a requirement that signals don't overlap, or at least that they don't conflict. One way of ac…
Description In a wireless network with multiple transmitters sending on the same frequencies, it is often a requirement that signals don't overlap, or at least that they don't conflict. One way of accomplishing this is to restrict a transmitter's cov…
http://poj.org/problem?id=1106 Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 4488   Accepted: 2379 Description In a wireless network with multiple transmitters sending on the same frequencies, it is often a requirement that signals don…
地址:http://poj.org/problem?id=1106 题目: Transmitters Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 5405   Accepted: 2873 Description In a wireless network with multiple transmitters sending on the same frequencies, it is often a requirem…
Poj 1106 Transmitters 传送门 给出一个半圆,可以任意旋转,问这个半圆能够覆盖的最多点数. 我们枚举每一个点作为必然覆盖点,那么使用叉积看极角关系即可判断其余的点是否能够与其存在一个半圆内 import java.io.*; import java.util.*; public class Main { static class Point implements Comparable<Point> { double x, y; @Override public int co…
题目链接 切计算几何,感觉计算几何的算法还不熟.此题,枚举线段和圆点的直线,平分一个圆 #include <iostream> #include <cstring> #include <cstdio> #include <cstdlib> #include <cmath> using namespace std; #define eps 1e-8 struct point { double x,y; }p[]; double dis(point…
原题链接 题目大意:有一个发射站,覆盖范围是半径一定的一个半圆.在一个1000*1000平方米的地盘里有很多接收站.给定发射站的圆心,求最佳角度时能覆盖接收站的个数. 解法:本质上就是给一个原点和其他若干点,找出一个可以覆盖最多点的半圆.用了两个函数判断,一个是判断两点之间的距离,即该点到原点的距离是否在半径之内,筛选出第一步满足的点.另一个是判断两个点A.B是否在同一个半圆内,其实先确定一条直线AO,然后规定B点在AO的左侧就算在半圆内.每个点都遍历一次,找出最大值即可. 参考代码: #inc…
原题地址:http://poj.org/problem?id=1106 题目大意: 给定一些平面的点以及一个圆心和半径,过圆心作一个半圆,求点在半圆中点最多多少个. 解题思路: 首先将给定点中和圆心的距离超过半径的点排除,然后遍历每个点,作点和圆心的连线,求出一边的点的个数,取最大值就是答案. 代码: #include<stdio.h> #include<iostream> #include<cmath> using namespace std; class point…
题目链接:http://poj.org/problem?id=1106 算法思路:由于圆心和半径都确定,又是180度,这里枚举过一点的直径,求出这个直径的一个在圆上的端点,就可以用叉积的大于,等于,小于0判断点在直径上,左,右. 这里要记录直径两边的加直径上的点的个数,去最大的. 代码: #include<cstdio> #include<cstring> #include<cmath> #include<iostream> #include<algo…
题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=291 cross product: for 2 vectors a and b, if a^b > 0, a is in the clockwise direction of b. else if a^b < 0, a is in the anti-clo…