上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 22 下一页

2017年2月17日

HDU 5969

摘要: B君和G君聊天的时候想到了如下的问题。 给定自然数l和r ,选取2个整数x,y满足l <= x <= y <= r ,使得x|y最大。 其中|表示按位或,即C、 C++、 Java中的|运算。 转换成二进制 左边和右边相等 是1 显然 这一位可以取1 不相等可以转化成比小的那个大 然后都是1 后面都 阅读全文

posted @ 2017-02-17 20:10 HelloWorld!--By-MJY 阅读(164) 评论(0) 推荐(0) 编辑

HDU 5095

摘要: 题意 把 f(x,y,z) = ax^2 + by^2 + cy^2 + dxy + eyz + fzx + gx + hy + iz + j 变成g(p,q,r,u,v,w,x,y,z) = ap + bq + cr + du + ev + fw + gx + hy + iz + j 真的麻烦 坑 阅读全文

posted @ 2017-02-17 20:06 HelloWorld!--By-MJY 阅读(139) 评论(0) 推荐(0) 编辑

2017年2月8日

模拟退火 poj 1379

摘要: t X Y n 求一个点 到n个点最短距离 最大 阅读全文

posted @ 2017-02-08 14:29 HelloWorld!--By-MJY 阅读(131) 评论(0) 推荐(0) 编辑

2017年1月30日

三分 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 阅读(111) 评论(0) 推荐(0) 编辑

2017年1月20日

树链剖分 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 阅读(187) 评论(0) 推荐(0) 编辑

2017年1月19日

树链刨分 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 阅读(239) 评论(0) 推荐(0) 编辑

2017年1月16日

容斥 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 阅读(101) 评论(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 阅读(127) 评论(0) 推荐(0) 编辑

2017年1月15日

线段树 扫描线 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 阅读(145) 评论(0) 推荐(0) 编辑

线段树扫描线 HDU 1542

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

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

上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 22 下一页

导航