
数学-计算几何
数论只会GCD
研二在读
展开
-
SPOJ-CIRU 多圆并面积(计算几何-辛普森积分)
传送门:SPOJ-CIRU题解辛普森积分公式先预处理被包含或者退化成点的圆分开处理具体见代码注释heart: 既然确定负责数学部分, 也只好入计算几何的坑, 刚开始真的懵好久(太菜) 这道题质量很不错, 如果先学辛普森积分会好很多, 不过这样也能学很多东西, 就是要能看下去了TAT 积分公式 + 常规计算几何处理方法, 万事开头难.code:#include <cstdi原创 2017-04-08 17:14:27 · 1479 阅读 · 1 评论 -
POJ 2653 线段相交
code : #include #include #include #include #include using namespace std;typedef double ld;const int N = 100010;const ld eps = 1e-8;int n;struct Point{ ld x, y; Point(ld _x =原创 2017-04-23 12:01:49 · 354 阅读 · 0 评论 -
poj 1556 线段相交 + dijstra
code : #include <cstdio>#include <cmath>#include <vector>#include <cstring>using namespace std;typedef double ld;const ld eps = 1e-13;int n;ld dis[75][75], ans[75];ld x, d, md, mu, u;bool vis[7原创 2017-04-13 22:34:25 · 332 阅读 · 0 评论 -
POJ 1269
code:#include <cmath>#include <cstdio>#include <utility>using namespace std;typedef double ld;int n;struct Point{ int x, y; void read(){ scanf("%d%d", &x, &y); }}s1, e1, s2, e2原创 2017-04-13 13:32:34 · 434 阅读 · 0 评论 -
CF 350D 直线映射 + 差分
刚开始想的按圆半径排序, 按线段的x坐标较小的那个点排序, 二分缩小范围, 第12个case T了, 才意识到不是纯粹几何题.后来想到了斜率 + 截距映射直线, 然后要考虑映射是同一条直线的线段集合在以为空间上映射的点的次数, 其中还有斜率不存在情况, 只能想到树状数组, 没接触过差分. 然后这个这个映射 + 次数的预处理要用到不止一种stl, 觉得自己能力不足只能去看题解: 1. 预处理原创 2017-04-13 11:38:51 · 585 阅读 · 0 评论 -
POJ 3304 直线与线段相交判断
code:#include <iostream>#include <cstring>#include <cmath>using namespace std;typedef double ld;const ld eps = 1e-8;const int N = 110;struct line{ ld p[2][2];}l[N];struct vec{ ld x, y;原创 2017-04-11 20:49:50 · 523 阅读 · 0 评论 -
POJ 2398
题解:2318+排序 #include #include #include using namespace std;const int N = 1000 + 10;int ans[N], mp[N];int n, m, x1, y1, x2, y2, up, down, x, y;struct line{ int u, l; bool opera原创 2017-04-11 11:16:40 · 422 阅读 · 0 评论 -
POJ 2318 叉积 + 枚举
code:#include #include #include using namespace std;const int N = 5000 + 10;struct point{ int x, y; point(int _x = 0, int _y = 0):x(_x), y(_y){}; bool operator < (const point &rhs) const{原创 2017-04-10 21:22:43 · 332 阅读 · 0 评论 -
LA 3485 辛普森公式求积分
传送门 : LA 3485题解曲线积分知识(弧长公式): 若可导曲线函数为f(x)其弧长公式为 L=∫ba1+f′(x)2−−−−−−−−√L = \int_a^b\sqrt{1 + f\prime(x)^2} 所以这题抛物线设为f(x) = a(x - d)(x +d) 弧长为2∗∫d01+4a2x2−−−−−−−−√ 2 * \int _0^d\sqrt{1 + 4a^2x^2}先预原创 2017-04-09 15:03:42 · 1268 阅读 · 0 评论 -
HDU 1724 辛普森积分公式
code:#include #include #include using namespace std;typedef double ld;const ld eps = 1e-10;ld a, b, l, r;ld getf(ld x){return b / a * sqrt(a * a - x * x);}ld cal(ld l, ld r){ ld mid原创 2017-04-08 17:53:05 · 661 阅读 · 0 评论 -
POJ 1066 线段相交
题意 给定n面墙, 这n面墙可能相交, 给出一个点, 可以在墙(相交后)的中点开门, 求它出矩形的最少门数分析对于一面最小的不可分割的墙, 某一点到它的某一端如果不和其它墙相交, 直接可以开门穿过, 如果有相交的墙l, 就要先穿过l, 一次向上推, 直至不存在相交的墙, 那么可以直接从中点穿过….所以对于某个给定线段某个端点最小门数就是和其他线段相交数 + 1矩形四个顶点也要考虑所以原创 2017-04-25 12:44:57 · 361 阅读 · 0 评论