
--------------模板--------------
yphacker
心之所动,且就随缘去吧
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
hdu 5412 CRB and Queries(动态区间第k大值,区间能修改)(整体二分,树状数组套平衡树,线段树套treap)
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5412 解题思路: 官方题解: In this problem, we can use BIT and Treap. We use BIT for coding skill and each element of BIT is Treap. First, for eac原创 2015-08-25 17:23:46 · 2456 阅读 · 0 评论 -
二维几何基础模板(一)
点和向量都用两个数x,y表示: 一、常定义用 : struct Point { double x,y; Point(double x=0,double y=0):x(x),y(y){} // 构造函数,方便代码编写 }; typedef Point Vector; //从程序实现上,Vector只是Point的别名 //向量+向量=向量,点+向量=点原创 2015-08-10 19:17:50 · 505 阅读 · 0 评论 -
二维几何基础模板(三)
一、通过圆心角求坐标的函数 struct Circle { Point c; double r; Circle(Point c,double r):c(c),r(r) {} Point point(double a) { return Point(c.x+cos(a)*r,c.y+sin(s)*r); } };原创 2014-12-01 16:31:51 · 660 阅读 · 0 评论 -
二维几何基础模板(二)
一、直线交点 Point GetLineIntersection(Point P,Vector v,Point Q,Vector w) { Vector u=P-Q; double t=Cross(w,u)/Cross(v,w); return P+v*t; }原创 2014-09-28 16:16:09 · 514 阅读 · 0 评论