自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

jxy859的专栏

Genius only means hardworking all one's life.

  • 博客(16)
  • 收藏
  • 关注

原创 macro definition for cfs 、tc.

边集和树状数组#include #include #include #include #include #include #include #include #include #include #include const double pi=cos(-1.);const double eps=1e-6;const double eps1=1e-9;const

2012-08-16 22:19:17 735

原创 树状数组

http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=binaryIndexedTrees 超级讲解,hdu1166 敌兵布阵单点修改, 区间查询, (区间和)const int maxn=50000+123;int a[maxn], c[maxn];int n;int sum(int

2012-08-16 20:09:58 529

原创 一些偏的数据结构整理【整理+复习】

BKTree:matrix67's bloghttp://baike.baidu.com/view/2020247.htm  划分树: http://blog.csdn.net/jxy859/article/details/7755201可持久化线段树:kd-tree:树状数组:1166 敌兵布阵http://bl

2012-08-01 11:10:03 655

原创 动态规划 斜率优化

hdu4258/** * Covered Walkway * @author vanb *  * This problem would be pretty easy, if it weren't for the size of the data sets. * If the data sets were small, a simple DP solution would

2012-08-30 16:00:25 862

原创 zju monthly contest 2012 aug.

#include #include #include #include using namespace std;#pragma comment(linker, "/STACK:1024000000,1024000000")const int maxn=40000;const int inf=0x7fffffff;const int s=0;struct edge{

2012-08-28 18:25:27 554

原创 斜率优化

/** * Covered Walkway * @author vanb * * This problem would be pretty easy, if it weren't for the size of the data sets. * If the data sets were small, a simple DP solution would suffice: * *

2012-08-26 21:13:59 484

原创 树链剖分

http://blog.sina.com.cn/s/blog_7a1746820100wp67.html 别人转的讲解, 看的这个学的。感觉不是必要的方法, 其他方法也能做的, 一般要维护树种路径的最值时才需要这个算法spoj375对边权的路径剖分#include #include #include #include #include using names

2012-08-25 10:47:40 890

原创 2012 Multi-University Training Contest 10[hdu4390~4399]

多校终于结束了, 开始从后往前整理4390 Number Sequence容斥原理, 比赛的时候把10^25理解成2^25以为不会超long long, wa了好几次,最后队友提醒才看到#include #include #include #include #include #include #include #include #include #

2012-08-24 20:49:42 1364

原创 2012 Multi-University Training Contest 9[hdu4380~4389]

hdu 4386 Quadrilateral公式 或三分法枚举任意2边为临边的对角线。 hdu 4388 Stone Game II 博弈 , 很好的题比赛的时候由于4387卡住了, 而且4388的操作又太复杂, 所以没太仔细去分析题目的本质, 题目大致的意思是初始n堆石子 没人轮流选一堆石子进行操作, 该堆石子的总数设为a, 要求拿走一定数量的石子, 使其剩余k个

2012-08-22 23:02:20 813

原创 树形结构转换线性结构的方法(lca倍增)

这个讲的还不错的, 整理的很全  http://blog.csdn.net/lyhypacm/article/details/6734748hdu 3966dfs序是针对某条路径, 利用根到路径#include #include #include #include #include #include #include #include #includ

2012-08-18 20:05:11 1369

原创 2012 Multi-University Training Contest 8[hdu4370~4379]

4370 0 or 1就2种情况, 一种是1到n的最短路, 一种是包含1的环和包含n的环, 第一种情况直接sssp就好, 第二种比较好的处理方法就是枚举环的一个点, 然后用sssp得到的dist数组去求2个最小环, 相加即可,我的方法是再跑遍floyd, 不过要用dist优化一下, 提前排除不是最优解的情况, 1600ms水过#include #include #include

2012-08-16 18:24:26 729

原创 2012 Multi-University Training Contest 6[hdu4350~4359]

4351 Digital root4355 Party All the Time 两种解法, 一种三分,一种dp三分是要满足凹凸性的, 既二阶导数不变号, 这个很好证明的, 题目要求的是sigma|p-xi|^3*wi, 不妨对每项拆开讨论 :|p-xi|^3*wi ,当p>=xi时 原式为(p-xi)^3*wi 二阶导为(6p-6xi)*w

2012-08-09 18:29:38 779 2

原创 hdu2586[lca离线tarjon算法][递归与非递归]

hdu2586[lca]tarjon 是离线的算法,  在线的话会有倍增法和rmq,其实这2个方法有一曲同工之妙#include #include #include #include using namespace std;const int maxn=100000+123;#define forg(p,x) for(p=x; ~p; p=edge[p].nex

2012-08-09 11:46:45 957

原创 2012 Multi-University Training Contest 5[hdu4340~4349]

hdu4340#include #include #include #include #include #include #include #include #include #include #include const double pi=cos(-1.);const double eps=10e-6;const double eps1=10e-9;const

2012-08-08 13:30:44 694 1

原创 2012 Multi-University Training Contest 4[hdu4331~4339]

hdu 4332 Constructing Chimney 状态压缩dp+矩阵优化, 256×256的暴力方法,幂矩阵的预处理和某项为0时的跳出优化,时间1s多, 还要消化下那个循环移位取最小的神优化能化到35×35typedef long long ll;typedef unsigned int UI;using namespace std;const int SZ=256;c

2012-08-06 13:22:09 535

原创 2012 Multi-University Training Contest 3[hdu4320~4330]

hdu4222 candy http://acm.hdu.edu.cn/showproblem.php?pid=4322费用流 看题解构图过的, 同时利用了边的费用和流量 题解这里, 【题目大意】有N颗糖果和M个小孩,老师现在要把这N颗糖分给这M个小孩。每个小孩i对每颗糖j都有一个偏爱度Aij,如果他喜欢这颗糖,Aij = k,否则Aij = 1。小孩i觉得高兴当且仅当ΣCij×A

2012-08-01 11:12:12 601

空空如也

空空如也

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

TA关注的人

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