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…
原题链接 题目大意:有一个发射站,覆盖范围是半径一定的一个半圆.在一个1000*1000平方米的地盘里有很多接收站.给定发射站的圆心,求最佳角度时能覆盖接收站的个数. 解法:本质上就是给一个原点和其他若干点,找出一个可以覆盖最多点的半圆.用了两个函数判断,一个是判断两点之间的距离,即该点到原点的距离是否在半径之内,筛选出第一步满足的点.另一个是判断两个点A.B是否在同一个半圆内,其实先确定一条直线AO,然后规定B点在AO的左侧就算在半圆内.每个点都遍历一次,找出最大值即可. 参考代码: #inc…
Description We are given a figure consisting of only horizontal and vertical line segments. Our goal is to count the number of all different rectangles formed by these segments. As an example, the number of rectangles in the Figures 1 and 2 are 5 and…
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=28235#problem/A 题目大意:给出三维空间两个三角形三个顶点,判断二者是否有公共点,三角形顶点.边.内部算三角形的一部分. 解题思路:见模板 //******************************************************************************* #include<iostream> #include<algor…
Description In order to build a ship to travel to Eindhoven, The Netherlands, various sheet metal parts have to be cut from rectangular pieces of sheet metal. Each part is a convex polygon with at most 8 vertices. Each rectangular piece of sheet meta…
Problem A Communist regime is trying to redistribute wealth in a village. They have have decided to sit everyone around a circular table. First, everyone has converted all of their properties to coins of equal value, such that the total number of coi…
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=28235#problem/B 题目大意: 有两个同时再空间中匀速运动的导弹,告诉一个时间以及各自的初始坐标和该时间时的坐标,求运动过程中的最短距离 解题思路:  求出相对初位置.相对速度,则答案就是原点到射线型轨迹的距离,注意是射线!!! //*************************************************************************…
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=28417#problem/E 题目大意:依次给n个点围成的一个城堡,在周围建围墙,要求围墙离城墙的距离大于一定的值,求围墙最短长度(结果四舍五入 解题思路:求围住所有点的凸包周长+一个圆的周长 #include<iostream> #include<cmath> #include<string.h> #include<string> #include…
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=28417#problem/B     本题大意: 给定一个管道上边界的拐点,管道宽为1,求一束光最远能照到的地方的X坐标,如果能照到终点,则输出...   解题思路: 若想照的最远,则光线必过某两个拐点,因此用二分法对所有拐点对进行枚举,找出最远大值即可. #include<iostream> #include<cmath> #include<string.h>…
  http://acm.hust.edu.cn/vjudge/contest/view.action?cid=28417#problem/C 本题大意:有一个1X1的矩形,每边按照从小到大的顺序给n个点如图,然后对应连线将举行划分,求最大面积. 解题思路:暴力算出各点,求出各面积 #include<iostream> #include<cmath> #include<string.h> #include<string> #include<stdio.…