自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 POJ 1987 Distance Statistics 树上点分治

算是入门题了,详见《分治算法在树的路径问题中的应用》(by 漆子超)。#include #include #include #include #include #include #include #include #include #define LL long long#define INF 0x3f3f3f3f#define Mod 1000000007#def

2015-05-16 10:51:51 675

原创 树的重心

拿掉重心后,最大的联通分量的点的个数最少。using namespace std;const int MAXE = 80010;const int MAXP = 40010;struct EDGE{ int v,next;}edge[MAXE];int head[MAXP];int Top;void Link(int u,int v){ edge[Top

2015-05-16 08:53:23 704

原创 无向图求桥,允许重复边

#include #include #include #include #include #include #include #include #include #define LL long long#define INF 0x3f3f3f3f#define Mod 1000000007#define Seed1 31#define Seed2 37#define

2015-05-15 16:03:17 1456

原创 无向图求割点

using namespace std;const int MAXE = 300010;const int MAXP = 1010;struct N{ int v,next;}edge[MAXE*2];int head[MAXP];int Top;int high[MAXP];int low[MAXP];int subnet[MAXP];int dfsClock;

2015-05-15 15:04:13 1016

原创 有向图的强联通分量 tarjan

多与DAG上的DP之类的问题一起出现。using namespace std;const int MAXE = 300010;const int MAXP = 100010;struct N{ int v,next;}edge[MAXE];int head[MAXP];int Top;int ty[MAXP];int high[MAXP];int low

2015-05-15 10:38:45 992

原创 Codeforce 487B Strip 动归+二分+线段树

写完之后的第一感觉就是我又写麻烦了。。。写了两棵线段树维护信息。。。dp[i] 表示[1,i]这段前缀的最优解,若dp[i] = INF,表示无解。特殊的,dp[0] = 0。那么,有一个思路就是我们有一些长度为设dp[i]已知且dp[i] != INF,那么设我们知道一个位置R,满足[i+1,R]这一段区间可以划分到一段,i+1 = l。那么我们将dp[i+1],dp[i+2].

2015-05-04 17:44:32 1037

空空如也

空空如也

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

TA关注的人

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