1.三角形的所有端点 2.过所有三角形的端点对所有圆做切线,得到所有切点. 3.做任意两圆的外公切线,得到所有切点. 对上述所有点求凸包,标记每个点是三角形上的点还是某个圆上的点. 求完凸包后,因为所有点都是按逆时针(或顺时针)排好序的,如果相邻两点在同一圆上,那么求这段圆弧的距离,否则求这段直线的距离.最后得到所有周长. #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath…
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…
//大白p263 #include <cmath> #include <cstdio> #include <cstring> #include <string> #include <queue> #include <functional> #include <set> #include <iostream> #include <vector> #include <algorithm> u…
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…
题意: 给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…
HDU 5130 Signal Interference(计算几何 + 模板) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5130 Description Two countries A-Land and B-Land are at war. The territory of A-Land is a simple polygon with no more than 500 vertices. For military use, A-Land co…
HDU 5033 Building(单调栈) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5033 Description Once upon a time Matt went to a small town. The town was so small and narrow that he can regard the town as a pivot. There were some skyscrapers in the town, each l…
Problem Description After enjoying the movie,LeLe went home alone. LeLe decided to build blocks. LeLe has already built  piles. He wants to move some blocks to make  consecutive piles with exactly the same height . LeLe already put all of his blocks…