01 2017 档案

三分 HDU 5144
摘要:#include #include #include #include using namespace std; #define g 9.8 const double pi = 4*atan(1.0); double v,h; double f(double a) { return v*cos(a)*v*sin(a)/g+v*cos(a)*sqrt(v*v*sin(a)*si... 阅读全文

posted @ 2017-01-30 19:07 HelloWorld!--By-MJY 阅读(119) 评论(0) 推荐(0)

树链剖分 poj 2763
摘要:n个点q个查询开始位置s n-1条边 a b c a b之间有一条边 权值为c q个查询 0 a 输出现在的位置到 a 所需时间 1 a b 更新第a条边的权为b 阅读全文

posted @ 2017-01-20 09:24 HelloWorld!--By-MJY 阅读(196) 评论(0) 推荐(0)

树链刨分 HDU 3966
摘要:树 n个点 m条边(其实就是n-1) q个询问 a1 a2 a3 ... 这些节点开始的人 I a b c a->b 这条链上的都加c D ... 减 q a 查询节点a上的人 具体看代码上的注释 阅读全文

posted @ 2017-01-19 11:20 HelloWorld!--By-MJY 阅读(252) 评论(0) 推荐(0)

容斥 HDU 2204
摘要:#include #include #include #include using namespace std; vectors; int z[]={2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67}; typedef __int64 LL; void Init() { for(int i=... 阅读全文

posted @ 2017-01-16 14:10 HelloWorld!--By-MJY 阅读(114) 评论(0) 推荐(0)

最小生成树 prim算法
摘要:#include<stdio.h> #include<string.h> #define inf 100000000 #define MAXN 100010 struct edge { int to,w,next; }x[MAXN]; int head[MAXN]; int cnt; void ad 阅读全文

posted @ 2017-01-16 09:29 HelloWorld!--By-MJY 阅读(136) 评论(0) 推荐(0)

线段树 扫描线 HDU 1828
摘要:#include #include #include #include using namespace std; #define inf 100000000 #define MAXN 5010 #define MAXN 20010 struct edge { int l,r,h,f; //线段的 左边 右边 高度 }x[MAXN>1; Build(l,mid,a>1;... 阅读全文

posted @ 2017-01-15 15:34 HelloWorld!--By-MJY 阅读(152) 评论(0) 推荐(0)

线段树扫描线 HDU 1542
摘要:n个矩形 问他们覆盖的面积重复的就算一次 x数组存线段 然后根据横坐标排一下 z 线段树 l - r 就是1 ~ 2*n 阅读全文

posted @ 2017-01-15 10:42 HelloWorld!--By-MJY 阅读(132) 评论(0) 推荐(0)

凸包 poj 1873
摘要:我竟然A了 worldfinal 的水题 n<=15 所以可以列举每一种情况 状态压缩 阅读全文

posted @ 2017-01-14 10:26 HelloWorld!--By-MJY 阅读(144) 评论(0) 推荐(0)

凸包 poj 1113
摘要:求一个多边形 拐弯的地方用圆弧补上 距离>=l 求他的周长 求一个凸包的周长 加2*pi*l 阅读全文

posted @ 2017-01-13 16:23 HelloWorld!--By-MJY 阅读(116) 评论(0) 推荐(0)

线段树 HDU 2871
摘要:题意还是清楚的 就是维护很麻烦 阅读全文

posted @ 2017-01-13 11:12 HelloWorld!--By-MJY 阅读(171) 评论(0) 推荐(0)

AC自动机 HDU 3065
摘要:大概就是裸的AC自动机了 阅读全文

posted @ 2017-01-07 10:07 HelloWorld!--By-MJY 阅读(164) 评论(0) 推荐(0)

AC自动机 HDU 2222
摘要:t n个字串 1个母串 求出现几个字串 字串可能重复 阅读全文

posted @ 2017-01-06 09:19 HelloWorld!--By-MJY 阅读(140) 评论(0) 推荐(0)

AC自动机 HDU 2896
摘要:n个字串 m个母串 字串在母串中出现几次 阅读全文

posted @ 2017-01-05 21:49 HelloWorld!--By-MJY 阅读(206) 评论(0) 推荐(0)

推公式hdu2298
摘要:(0,0)点到(x,y)以v射箭 问 最小的角度 不能射到 -1 x=v*cos(a)*t; y=v*sin(a)*t-0.5*g*t*t; 消去t; y=x*tan(a)-0.5*g*x*x/(v*v*cos(a)*cos(a)); v*v*y=v*v*x*tan(a)-0.5*g*x*x*sec 阅读全文

posted @ 2017-01-02 16:57 HelloWorld!--By-MJY 阅读(238) 评论(0) 推荐(0)

递推 hdu 1330
摘要:http://www.cnblogs.com/rainydays/archive/2013/01/16/2862235.html 看样例的答案 阅读全文

posted @ 2017-01-02 13:29 HelloWorld!--By-MJY 阅读(131) 评论(0) 推荐(0)

递推 hdu 1396
摘要:给你边长为n的等边三角形 算有几个三角形 z[1]=1; 第N层 z[n] 1 n-1层 z[n-1] 2 2*n-1 个小的 3 新产生的 正的>1的三角形 n*(n-1)/2; 4 新产生的倒的>1的三角形 /这边可以去推一推 阅读全文

posted @ 2017-01-02 09:49 HelloWorld!--By-MJY 阅读(183) 评论(0) 推荐(0)

递推 hdu 3411
摘要:http://blog.csdn.net/wust_xhj/article/details/47779539 怎么推可以看这里 f[0]=0 f[1]=1 [0,1]* | 0 q |(n-1)=[f(n-1),f(n)] | 1 q-1| 跑一下快速幂 阅读全文

posted @ 2017-01-01 14:11 HelloWorld!--By-MJY 阅读(154) 评论(0) 推荐(0)

导航