上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 25 下一页
摘要: 线段树:http://www.notonlysuccess.com/index.php/segment-tree-complete/主席树:http://blog.csdn.net/metalseed/article/details/8045038http://seter.is-programmer.com/posts/31907.html划分树:http://wenku.baidu.com/view/8fc6bc365a8102d276a22fa0.htmlhttp://blog.csdn.net/zxy_snow/article/details/6681086 阅读全文
posted @ 2013-06-20 21:54 冰鸮 阅读(340) 评论(0) 推荐(0)
摘要: 航线算球面距离,需要经纬度转空间坐标。任意两点间距离用Floyd求出来,查询时直接查表。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 8 using namespace std; 9 10 const int MAXN = 110; 11 const double INF = 1e30; 12 const double eps = 1e-8; 13 const double PI = acos( -1.0 ); 14 15 struct Point 16 { 17 ... 阅读全文
posted @ 2013-06-20 00:12 冰鸮 阅读(285) 评论(0) 推荐(0)
摘要: 求出所有交点枚举每个四边形找最大面积即可。 1 #include 2 #include 3 #include 4 5 using namespace std; 6 7 const int MAXN = 40; 8 9 const double eps = 1e-10; 10 11 struct Point 12 { 13 double x, y; 14 Point( double x = 0, double y = 0 ):x(x), y(y) { } 15 }; 16 17 typedef Point Vector; 18 19 Vecto... 阅读全文
posted @ 2013-06-19 21:33 冰鸮 阅读(285) 评论(0) 推荐(0)
摘要: 模板敲错了于是WA了好几遍……判断由红点和蓝点分别组成的两个凸包是否相离,是输出Yes,否输出No。训练指南上的分析:1.任取红凸包上的一条线段和蓝凸包上的一条线段,判断二者是否相交。如果相交(不一定是规范相交,有公共点就算相交),则无解2.任取一个红点,判断是否在蓝凸包内。如果是,则无解。蓝点红凸包同理。其中任何一个凸包退化成点或者线段时需要特判。其实只需要把上面两个判断顺序颠倒一下,就可以不需要特判。先判断点是否在凸包内,因为这个考虑了点在凸包边界上的情况,所以后面判凸包线段是否相交时直接用规范相交判断即可。此时特殊情况包含在了上两种情况中,因此不需要特判。 1 #include 2... 阅读全文
posted @ 2013-06-18 18:20 冰鸮 阅读(918) 评论(0) 推荐(0)
摘要: 旋转卡壳求凸包直径。参考:http://www.cppblog.com/staryjy/archive/2010/09/25/101412.html 1 #include 2 #include 3 #include 4 5 using namespace std; 6 7 const int MAXN = 100022 1 && Cross( ch[m - 1] - ch[m - 2], p[i] - ch[m - 2] ) = 0; --i ) 59 { 60 while ( m > k && Cross( ch[m - 1] - ch[m ... 阅读全文
posted @ 2013-06-17 22:10 冰鸮 阅读(287) 评论(0) 推荐(0)
摘要: 旋转卡壳:http://blog.csdn.net/accry/article/details/6070626计算几何题目推荐:http://blog.csdn.net/accry/article/details/6070656先是计算几何入门题推荐:计算几何题的特点与做题要领:1.大部分不会很难,少部分题目思路很 巧妙2.做计算几何题目,模板很重要,模板必须高度可靠。3.要注意代码的组织,因为计算几何的题目很容易上两百行代码,里面大部分是模 板。如果代码一片混乱,那么会严重影响做题正确率。4.注意精度控制。5.能用整数的地方尽量用整数,要想到扩大数据的方法(扩大一倍, 或扩大sqrt2)。因 阅读全文
posted @ 2013-06-17 16:52 冰鸮 阅读(652) 评论(2) 推荐(0)
摘要: 推公式 1 #include <cstdio> 2 #include <cmath> 3 4 double Cal( double a, double b, double c ) 5 { 6 return a + b - c; 7 } 8 9 int main()10 {11 int T;12 scanf( "%d", &T );13 while ( T-- )14 {15 double m[3], n[3], r;16 scanf( "%lf", &r );17 for ( int i = 0; i ... 阅读全文
posted @ 2013-06-17 16:40 冰鸮 阅读(423) 评论(0) 推荐(0)
摘要: 不完整,待补充#include #include #include using namespace std;const double eps = 1e-10;struct Point{ double x, y; Point( double x = 0, double y = 0 ):x(x), y(y) { }};typedef Point Vector;Vector operator+( Vector A, Vector B ) //向量加{ return Vector( A.x + B.x, A.y + B.y );}Vector operator-( Vec... 阅读全文
posted @ 2013-06-16 21:00 冰鸮 阅读(259) 评论(0) 推荐(0)
摘要: 因为两段圆弧在同一个圆上,所以该圆是矩形的外接圆,由此可通过圆心角解得两段圆弧长,设矩形的长为x,宽为y,列出方程可解得:x = 400.0 / ( 2.0 + ( 2.0 * atan( b / a ) * sqrt( a*a + b*b ) ) / a )y = x * b / a; 1 #include <cstdio> 2 #include <cmath> 3 #include <algorithm> 4 5 using namespace std; 6 7 int main() 8 { 9 int cas = 0;10 double a, b;11 阅读全文
posted @ 2013-06-16 14:00 冰鸮 阅读(264) 评论(0) 推荐(0)
摘要: 设宽度为w,二分w。 1 #include <cstdio> 2 #include <cmath> 3 #include <algorithm> 4 5 #define eps 1e-6 6 7 using namespace std; 8 9 int main()10 {11 double x, y, c;12 while ( ~scanf( "%lf%lf%lf", &x, &y, &c ) )13 {14 double high = min( x, y );15 double low = 0.0;16 dou 阅读全文
posted @ 2013-06-15 23:44 冰鸮 阅读(357) 评论(0) 推荐(0)
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 25 下一页