C - Building Fence】的更多相关文章

Building Fence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 171    Accepted Submission(s): 25Special Judge Problem Description Long long ago, there is a famous farmer named John. He owns a bi…
A - Building Fence Time Limit:1000MS     Memory Limit:65535KB     64bit IO Format:%I64d & %I64u Submit Status Description Long long ago, there is a famous farmer named John. He owns a big farm and many cows. There are two kinds of cows on his farm, o…
Long long ago, there is a famous farmer named John. He owns a big farm and many cows. There are two kinds of cows on his farm, one is Friesian, and another one is Ayrshire. Each cow has its own territory. In detail, the territory of Friesian is a cir…
题意: 给n个圆和m个三角形,且保证互不相交,用一个篱笆把他们围起来,求最短的周长是多少. 做法:--水过... 把一个圆均匀的切割成500个点,然后求凸包. 注意:求完凸包,在求周长的时候记得要把圆的那部分特殊求. sin(x)  x=PI*(i/j)://度数表示的时候用PI: #include<stdio.h> #include<iostream> #include<math.h> #include<algorithm> #define PI 3.14…
题意:给n个圆和m个三角形,且保证互不相交,用一个篱笆把他们围起来,求最短的周长是多少. 解法1:在每个圆上均匀的取2000个点,求凸包周长就可以水过. 解法2:求出所有圆之间的外公切线的切点,以及过三角形每个顶点的的直线和圆的切点,和三角形的三个顶点.这些点做凸包确定篱笆边上的图形.凸包的边和圆弧之和即为所求.求圆弧长度的时候要判断是优弧还是劣弧.用叉积判断两个向量的方向关系即可. //Time:218MS //Memory:860K include <cstdio> #include &l…
大致题意: 给出n个圆和m个三角形,求最小的的,能将所有图形覆盖的图形的周长. 正解为求所有三角形顶点与圆的切点以及圆和圆的切点构造凸包,再求路径. 因为要求结果误差<=1e-3 所以 我们可以在每个圆上,将圆分为1000(或更多)等分,得到每个圆上有1000个点,把这些点和三角形的顶点构造凸包,为减小误差,圆上两点的距离依然为圆弧的长度.这样累加边即可得答案. #include<cstdio> #include<iostream> #include<cstring&g…
1.三角形的所有端点 2.过所有三角形的端点对所有圆做切线,得到所有切点. 3.做任意两圆的外公切线,得到所有切点. 对上述所有点求凸包,标记每个点是三角形上的点还是某个圆上的点. 求完凸包后,因为所有点都是按逆时针(或顺时针)排好序的,如果相邻两点在同一圆上,那么求这段圆弧的距离,否则求这段直线的距离.最后得到所有周长. #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath…
//大白p263 #include <cmath> #include <cstdio> #include <cstring> #include <string> #include <queue> #include <functional> #include <set> #include <iostream> #include <vector> #include <algorithm> u…
HDU 4666 Hyperspace 曼哈顿距离:|x1-x2|+|y1-y2|. 最远曼哈顿距离,枚举x1与x2的关系以及y1与y2的关系,取最大值就是答案. #include<cstdio> #include<set> #define oo 0x7FFFFFFF #define MAXM 35 #define MAXN 100010 using namespace std; multiset<int> myset[MAXM]; struct Ask { int c…
题目链接:http://poj.org/problem?id=1037 Description Richard just finished building his new house. Now the only thing the house misses is a cute little wooden fence. He had no idea how to make a wooden fence, so he decided to order one. Somehow he got his…