摘要: 很慢的线段树,不过可以作为最简单的模板。代码风格学的Not Only Success。C++过,G++不过。#include #include #define lson l,m,rtb?b:a;}int max(int a,int b){ return a>b?a:b;}void build... 阅读全文
posted @ 2013-07-04 23:17 little_hsu 阅读(133) 评论(0) 推荐(0) 编辑
摘要: double ternarySearch(double l,double r){ while(r-l < eps) { double mid = (l + r)/2; double midmid = (mid + r)/2; if(cal(mid... 阅读全文
posted @ 2013-07-04 22:44 little_hsu 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 纯二分 水#include #include #include using std::memset;using std::sort;const int MAX = 2005;int n;struct position{ int x,y;}star[MAX];;bool cmp(position a,... 阅读全文
posted @ 2013-07-04 15:29 little_hsu 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 最大流基础题。基本的思路是:先找增广路,路上的流量减掉,反流量(名字忘记了)加上,直到找不到增广路。#include #include #include #include using std::queue;using std::memset;const int MAX = 400;int flow[... 阅读全文
posted @ 2013-07-04 00:42 little_hsu 阅读(117) 评论(0) 推荐(0) 编辑