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…
1514 -- Metal Cutting 一道类似于半平面交的题. 题意相当简单,给出一块矩形以及最后被切出来的的多边形各个顶点的位置.每次切割必须从一端切到另一端,问切出多边形最少要切多长的距离. 因为最短的切割距离肯定是没有多余的切割痕迹的,而且对于多边形的每一条边,都需要至少经过一次,也就是这些是必要切割.又因为最多就只有8条切割的痕迹,所以我们可以枚举每条痕迹的先后次序,然后模拟切割即刻.复杂度O(n!*n). 代码如下: #include <cstdio> #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.…
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=28235#problem/A 题目大意:给出三维空间两个三角形三个顶点,判断二者是否有公共点,三角形顶点.边.内部算三角形的一部分. 解题思路:见模板 //******************************************************************************* #include<iostream> #include<algor…
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=28417#problem/E 题目大意:依次给n个点围成的一个城堡,在周围建围墙,要求围墙离城墙的距离大于一定的值,求围墙最短长度(结果四舍五入 解题思路:求围住所有点的凸包周长+一个圆的周长 #include<iostream> #include<cmath> #include<string.h> #include<string> #include…
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…
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…