自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(80)
  • 收藏
  • 关注

原创 HDU 1556 Color the ball(树状数组)

依旧是树状数组,只不过题意是区间修改,单点查询网上的模板的写法感觉很不直观,按照自己的理解写了,和模板不太一样不过也A了其实可以转化为区间查询单点修改。一次[a,b,+1]的修改可以拆分为[1,b,+1]和[1,a-1,-1]两个修改,这样就转化为所有修改都是[1, i]这种了令arr[i]表示对[1, i]的修改的累加值则所求i涂色几次求的就是arr[i]+arr[i+1]+

2016-11-09 20:32:57 212

原创 HDOJ 1166 敌兵布阵(超裸树状数组)

题意:裸树状数组,点更新区间查询第一道树状数组,写的很详细#include using namespace std;const int maxn = 51000;int arr[maxn];int tree[maxn];int n;int lowbit(int x){ return x & -x;}void update(int pos, int del

2016-11-09 18:45:27 246

原创 ZOJ3732 Graph Reconstruction(图的构造)

主要坑在了多解时,这时如果

2014-07-31 19:41:05 456

原创 ZOJ3735 Josephina and RPG(简单DP)

RT。#include #include #include using namespace std;const int maxm = 120, maxn = 1e4;int n;double tab[maxm][maxm];double dp[maxm][maxn];int a[maxn];int main(){ int m, n; while (~sc

2014-07-31 19:39:50 467

原创 ZOJ3728 Collision (计算几何,圆)

通过这题学到了:①全部增加 r ,使 r 的圆可以看做一个点。

2014-07-31 19:36:10 359

原创 ZOJ3726 Alice's Print Service(二分)

二分即可,注意有的价格会

2014-07-31 19:35:54 378

原创 POJ2187 Beauty Contest(最远点对,凸包+旋转卡壳)

最远点对裸题。#include#include#include#includeusing namespace std;const int MAXN=5e4+100;struct Point{ int x,y; Point(){} Point(int _x,int _y) { x = _x;y = _y; } //向

2014-07-31 19:33:38 304

原创 POJ1329 Circle Through Three Points(解析几何,圆)

推出圆的公式即可。

2014-07-31 19:31:32 376

原创 POJ1375 Intervals(解析几何,圆)

解析利用角度之间的关系推出公式

2014-07-31 19:29:41 409

原创 POJ 2420 A Star not a Tree?(随机变步长贪心)

第一次做随机算法的题目。首先随机一个点,ran

2014-07-23 22:39:52 268

原创 POJ 2002 Squares (已知正方形对角线两点推另外两点,STL set)

枚举正方形对角线两点,推出lingw

2014-07-23 22:38:01 873

原创 POJ 1434 Fill the Cisterns!(二分)

二分答案。#include #include #include #include using namespace std;const int maxn = 50100;const double ub = 2e6, eps = 1e-8;double b[maxn], h[maxn], w[maxn], d[maxn], v;int sgn(double x) {return

2014-07-23 22:34:49 283

原创 POJ 2540 半平面交

半平面交,套模板。

2014-07-23 22:30:57 349

原创 POJ 1945 Power Hungry Cows(打表技巧)

这题正解貌似是启发式搜索,直接暴搜的话超时,但是又chaod

2014-07-23 22:28:42 7338 1

原创 POJ 1755 Triathlon(n^2 半平面交, 两点式和参数式直线求交点)

感觉就是处理成不等式然后求半平面交,但是用 nlogn 的那个模板过不去,houl

2014-07-23 22:26:27 630

原创 POJ 2451 Uyuw's Concert(半平面交,求面积,裸)

RT。。#include #include #include #include #include #include #include #include #include #include #include #include using namespace std;const double eps = 1e-8;const double PI = acos(-1.0)

2014-06-30 21:46:37 360

原创 POJ 3384 Feng Shui(半平面交)

题意:在一个多边形里放两个馆

2014-06-30 21:45:06 368

原创 POJ 1279 Art Gallery

半平面交,求多边形核的面积

2014-06-23 19:23:14 305

原创 POJ 1474 Video Surveillance(半平面交)

和POJ3335几乎一样。。//poj1474#include #include #include #include #include #include #include #include #include #include #include #include using namespace std;const double eps = 1e-8;const do

2014-06-23 18:20:52 381

原创 POJ 3130 How I Mathematician Wonder What You Are!(半平面交)

和 POJ3335 几乎一模一样。。//poj3130#include #include #include #include #include #include #include #include #include #include #include #include using namespace std;const double eps = 1e-8;cons

2014-06-23 18:14:50 368

原创 POJ 3335 Rotating Scoreboard (半平面交)

显然如果对所有墙壁求半平面交结果

2014-06-23 18:08:01 355

原创 POJ 2954 Triangle(pick定理,边上整点数)

RT。。#include #include #include #include using namespace std;const double eps = 1e-8;int sgn(double x){ if(fabs(x) < eps)return 0; if(x < 0)return -1; else return 1;}struct Poin

2014-06-23 17:15:59 383

原创 POJ 1265 Area (有向面积, pick 定理)

pick 定理: S = a + b#include #include #include using namespace std;struct Point{ int x,y; Point(){} Point(double _x,double _y) { x = _x;y = _y; } //向量 Point o

2014-05-29 22:57:34 462

原创 POJ 1654 Area (有向面积求多边形面积)

#include #include #include #include using namespace std;struct Point{ double x,y; Point(){} Point(double _x,double _y) { x = _x;y = _y; } //向量 Point operator

2014-05-29 22:51:57 554

原创 POJ 3348 Cows (凸包面积)

#include#include#include#includeusing namespace std;const int MAXN=1000;const double PI=acos(-1.0);struct Point{ double x,y; Point(){} Point(double _x,double _y) { x =

2014-05-29 22:50:18 399

原创 POJ 1873 (枚举子集+凸包)

很久以前的 final 里的水题。。

2014-05-28 22:54:59 500

原创 POJ 2007 (极角排序)

极角排序裸题。。

2014-05-28 22:50:53 701

原创 POJ 1228 (凸包)

题意看了很久才懂。。判断给定的凸包能否we

2014-05-28 22:48:45 531

原创 POJ 1584 A Round Peg in a Ground Hole(判断凸多边形,点到线段最短距离)

圆在多边形内的条件是:圆心在多边形内,且圆心到个

2014-05-27 15:30:03 524

原创 POJ 3449 Geometric Shapes (多边形相交)

思路比较简单,输入输出哟

2014-05-27 15:27:21 436

原创 POJ 1039 Pipe(线段直线相交)

终于把这题过了。。。体会到了计算几何的特点

2014-04-24 13:14:26 379

原创 POJ 1696 Space Ant(卷包裹)

这题严格来说不是凸包的题,只是用到了凸包的卷包裹

2014-04-17 19:26:52 350

原创 POJ 3347 Kadj Squares(技巧)

题意挺简单,思路也不难,但是开始一直WA。这里的技巧就是

2014-04-17 12:01:03 416

原创 POJ 1410 Intersection(线段相交)

判断线段是否与矩形有交集。。刚开始看成直线错了好几发。。

2014-04-15 21:16:43 310

原创 1066 Treasure Hunt (判断线段相交)

题意:100 * 100 的封闭房子,有一些贯穿整个房子的墙(从一题边到另一边

2014-04-15 13:33:32 298

原创 POJ 3304 Segments(线段直线相交)

题意:求是否有一条直线,与给出的所有

2014-04-15 12:20:08 314

原创 POJ 1556 The Doors(判断线段相交 + 最短路)

RT。。题意和思路不是很复杂

2014-04-12 20:28:29 382

原创 POJ 2653 Pick-up sticks(判断线段相交)

题意:按顺序扔一些木棒,问最后在最上面的木棒。

2014-04-10 21:24:46 267

原创 POJ 1269 Intersecting Lines(直线位置关系,水)

利用叉积判断直线位置关系,叉积为0则共线或ping

2014-04-09 21:09:57 385

原创 POJ 2398 Toy Storage(叉乘,水)

和POJ 2318 几乎一模一样,只是多了个排序,然后输出格式个

2014-04-08 12:59:44 548

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除