随笔分类 - ACM — 计算几何
摘要:http://www.bnuoj.com/bnuoj/problem_show.php?pid=4209题意:如题题解:公式直接计算,或者角平分线求交点【code1】: 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 //定义点 9 struct point10 {11 double x,y;12 };13 14 typedef struct point point;15 16 17 double fabs(double x)18 {19 return ...
阅读全文
摘要:http://www.bnuoj.com/bnuoj/problem_show.php?pid=1053【题意】:基本上就是求直线与圆的交点坐标【题解】:这种题我都比较喜欢用二分,三分做,果然可以完爆,哈哈,特有成就感的说。。。【code】: 1 #include 2 #include 3 #include 4 #include 5 6 using namespace std; 7 #define eps 1e-12 8 9 struct Point 10 { 11 double x,y; 12 Point(){} 13 Point(dou...
阅读全文
摘要:http://www.bnuoj.com/bnuoj/problem_show.php?pid=27874【题意】:给你一个三角形三个顶点的坐标ABC,三角形各边取一点DEF,将三角形周长平均分割成两部分,求AE,DC,FB是否相交于一点,是,输出交点坐标,否,输出ERROR【题解】:几何体,一看就有点慌,就怕它卡精度,以前坑怕了,这里给出思路以及解题过程:先求出DEF的坐标再说,拿D举例:D在AB线段上,并满足AC+AD==DB+BC,这里我们可以用二分枚举来枚举出D的坐标EF点同上然后,CD与AE的交点O,判断O是不是也同时在BF上,在输出O的坐标,不在输出ERROR【ACcode】: .
阅读全文
摘要:http://acm.hunnu.edu.cn/online/?action=problem&type=show&id=11353 1 #include 2 #include 3 #include 4 #include 5 #define PI acos(-1) 6 //using namespace std; 7 struct Nod 8 { 9 int dir; 10 int len; 11 }node[200]; 12 struct Point 13 { 14 double x; 15 double y; 16 }; 17 struct segmemt ...
阅读全文
摘要:http://acm.uestc.edu.cn/problem.php?pid=1874&cid=217Wally WorldTime Limit: 1000 ms Memory Limit: 65535 kB Solved: 26 Tried: 135 DescriptionTwo star-crossed lovers want to meet. The two lovers are standing at distinct points in the plane (but then again, aren't we all?). They can travel freel
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2540Problem Description在一个广场上有一排沿着东西方向排列的石柱子,阳光从东边以一定的倾角射来(平行光)。有的柱子可能被在他东边的高大的柱子的影子给完全遮挡住了。现在你要解决的问题是求出有多少柱子是没有被完全遮挡住的。假设每个石柱子是一根细棒,而且都垂直于地面摆放。Input输入包含多组数据。每组数据第一行是一个整数N(0<N<=100000),表示柱子的个数。N=0代表输入结束。接下来有N行,每行是两个整数,分别给出每根柱子的水平位置X和高度H(X越大,表示越在西边,0<
阅读全文