自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

kido 在努力的生长

记录了kido zhang 的脑残历史

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

转载 树状dp的闲扯....

树,一种十分优美的数据结构,因为它本身就具有的递归性,所以它和子树见能相互传递很多信息,还因为它作为被限制的图在上面可进行的操作更多,所以各种用于不同地方的树都出现了,二叉树、三叉树、静态搜索树、AVL树,线段树、SPLAY树,后缀树等等..     枚举那么多种数据结构只是想说树方面的内容相当多,本专辑只针对在树上的动态规划,即树形DP.做树形DP一般步骤是先将树转换为有根树,然后在树上

2014-10-03 15:34:53 560

原创 zoj 3810 A Volcanic Island

四色原理模板题....A Volcanic IslandTime Limit: 2 Seconds      Memory Limit: 65536 KB      Special JudgeAn underwater volcano has erupted massively in somewhere of the deep Atlantis Ocean. This

2014-09-29 00:39:15 428

原创 状压dp

动态规划本来就很抽象,状态的设定和状态的转移都不好把握,而状态压缩的动态规划解决的就是那种状态很多,不容易用一般的方法表示的动态规划问题,这个就更加的难于把握了。难点在于以下几个方面:状态怎么压缩?压缩后怎么表示?怎么转移?是否具有最优子结构?是否满足后效性?涉及到一些位运算的操作,虽然比较抽象,但本质还是动态规划。找准动态规划几个方面的问题,深刻理解动态规划的原理,开动脑筋思考问题。这才是掌握动

2014-09-27 17:11:15 740

原创 我希望 明天的自己 像一道彩虹 还是刚淋过雨

首先,临界明天要比赛了,感觉算法还是没有看完,suir

2014-09-07 00:50:08 1098

原创 费用流!

DescriptionWhen FJ's friends visit him on the farm, he likes to show them around. His farm comprises N (1 <= N <= 1000) fields numbered 1..N, the first of which contains his house and the Nth of

2014-09-06 23:58:21 436

原创 网络流standard model

//Edmondes-Karp#include #include #include #define INF 0x7fffffffusing namespace std;queue q;const int maxn = 200;int n, m, ans;int next[maxn+10], p[maxn+10], f[maxn+10][maxn+10], cap[maxn+10]

2014-09-06 23:56:07 443

原创 hdu 4291

A Short problemTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 344    Accepted Submission(s): 131Problem Description  Acco

2014-09-05 21:33:19 483

转载 HDU 4288

Problem Description  In mathematics and computer science, an algorithm describes a set of procedures or instructions that define a procedure. The term has become increasing popular since the adven

2014-09-05 21:30:22 366

原创 HDOJ 4293 dp

Description  According to a research, VIM users tend to have shorter fingers, compared with Emacs users.   Hence they prefer problems short, too. Here is a short one:   Given n (1 18), You sho

2014-09-05 21:20:18 385

转载 HDU 4031 Attack(离线+线段树)

A - ATime Limit:3000MS     Memory Limit:65768KB     64bit IO Format:%I64d & %I64uSubmit StatusDescriptionToday is the 10th Annual of “September 11 attacks”, the Al Qaeda is about t

2014-09-03 21:34:48 2082

原创 裸floyd大法

这个题主要就是裸地

2014-09-03 20:16:23 416

原创 RMQ的在线和离线算法

online is

2014-08-26 00:05:08 640

原创 LCM~~~!!!

D - LCATime Limit:1000MS     Memory Limit:10000KB     64bit IO Format:%I64d & %I64uSubmit StatusDescriptionA rooted tree is a well-known data structure in computer science and en

2014-08-23 21:12:24 398

原创 RMQ的两种方法~

额  主要一个记录路径 一个记录正确的值 我觉得前者可能更好 手贱的拿

2014-08-22 15:33:13 617

转载 dp的开关路灯

An Easy GameTime Limit: 2 Seconds      Memory Limit: 65536 KBOne day, Edward and Flandre play a game. Flandre will show two 01-strings s1 and s2, the lengths of two strings are n. Then, Edwa

2014-08-22 09:52:53 423

原创 multi-

G - GTime Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64uSubmit StatusDescriptionDevu and his brother love each other a lot. As they are super geeks, they

2014-08-21 21:29:48 407

转载 prim算法

最小生成树prim算法实现今天从志权师兄那里学会了最小生成树。所谓生成树,就是n个点之间连成n-1条边的图形。而最小生成树,就是权值(两点间直线的值)之和的最小值。           首先,要用二维数组记录点和权值。如上图所示无向图:int map[7][7];       map[1][2]=map[2][1]=4;       map[

2014-08-21 18:34:29 407

转载 凸包的模板

WallTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 17387 Accepted: 5627DescriptionOnce upon a time there was a greedy King who or

2014-08-21 17:26:05 413

原创 凸包 你敢更残暴吗?

在学习了一些有关计算机几何的基础知识和一些基本工具之后要快速的解决一些简单的几何问题,如两点之间的距离、两线段的交点个数等等是可以轻松应付的,但是对于复杂点的几何问题,我们还是要有更好的算法,这样才可以更高效的解决它。在这一篇中来总结 平面凸包 的 Graham算法;http://www.cnblogs.com/jbelial/平面凸包 : 定义: 对一个简单多边形

2014-08-21 17:19:01 541

原创 树状数组解决!~~~~

DescriptionGiven an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the number in the i-th row and j-th column. Initially we have A[i, j] = 0 (1 We can change the matrix in the fol

2014-08-21 13:15:17 474

原创 优先队列~~~

E - 楼上哪里比楼上的楼上简单了?没看出来!但是我知道我最简单了!Time Limit:12000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64uSubmit StatusDescriptionAn array of size n ≤ 10 6 is given to you.

2014-08-19 21:13:51 303

原创 计算几何的基本应用~~~~

A - TOYSTime Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64uSubmit StatusDescriptionCalculate the number of toys that land in each bin of a partitioned to

2014-08-18 17:19:39 460

原创 计算几何的模板

其实还是万能的模板!!!!万岁~#include#include#includeusing namespace std;const double eps=1e-8;struct point{ double x,y; point(double x=0,double y=0):x(x),y(y) {};};int dcmp(double x){ if(fab

2014-08-18 14:50:52 351

原创 QAQ map 用法

暑假归来第一弹——————————————————————————————————————————————————————————————————————————————

2014-08-18 10:21:13 370

原创 优化下的来去问题

C - 模板Time Limit:8000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64uSubmit StatusDescriptionIn the age of television, not many people attend theater performances.

2014-07-30 22:04:49 420

原创 spfa的最小生成树~

#include#include#include#include#include#includeusing namespace std;#define N 210#define d double#define INF 0xffffffint n;int visit[N];d dis[N],len[N][N];d a,b,c;struct node{ d x,y;

2014-07-30 19:49:00 374

原创 图论~~!!!

A - 模板Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64uSubmit StatusDescriptionBessie is out in the field and wants to get back to the barn to get as m

2014-07-30 16:08:16 346

原创 倒序的拓扑排序

#include#include#includeusing namespace std;int chudu[209];int deg[209][209];int wei[209];int main(){int cases;scanf("%d",&cases);while(cases--){int n,m;scanf("%d%d",&n,&m)

2014-07-29 12:25:28 490

原创 拓扑排序

A - Sorting It All OutTime Limit:1000MS     Memory Limit:10000KB     64bit IO Format:%I64d & %I64uSubmit StatusDescriptionAn ascending sorted sequence of distinct values is one i

2014-07-28 20:39:57 361

转载 重载运算符的使用~~~

额  表示我对重载运算真的不熟啊....在前一节中曾提到过,C++中运行时的多态性主要是通过虚函数来实现的,而编译时的多态性是由函数重载和运算符重载来实现的。这一系列我将主要讲解C++中有关运算符重载方面的内容。在每一个系列讲解之前,都会有它的一些基础知识需要我们去理解。而运算符重载的基础就是运算符重载函数。所以今天主要讲的是运算符重载函数。  1.运算符重载是对已有的

2014-07-28 11:50:15 838

原创 矩阵的连乘

B - 矩阵快速幂Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64uSubmit StatusDescriptionJzzhu has invented a kind of sequences, they meet the following property

2014-07-28 11:30:27 393

原创 利用lazy显示树~(注意lazy的更新)

A - lazy标记Time Limit:5000MS     Memory Limit:131072KB     64bit IO Format:%I64d & %I64uSubmit StatusDescriptionYou have N integers, A1, A2, ... , AN. You need to deal with two ki

2014-07-26 21:42:24 377

原创 线段树 基础

D - 基础Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64uSubmit StatusDescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和

2014-07-26 13:47:07 366

转载 真跪了~!!!!!!! 并查集

题目就不在这里贴出了。这题目我不会,虽然知道是一道并查集的题目。上网搜答案,乱看一气,有以下几点体会:依然是并查集的find-union框架。除父子关系信息(最基本的并查集)之外,还附加了“与根结点谁吃谁(或者同类)”的信息。find函数中,与以往靠while循环寻找始祖不同,这次是递归调用find函数寻找始祖—这导致了路径压缩的根本性改变:沿途的所有结点都直接指向始祖了!规定

2014-07-24 20:49:05 413

原创 线段树

A - 基础Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64uSubmit StatusDescriptionAstronomers often examine star maps where stars are represented by points

2014-07-24 16:14:23 308

原创 花瓶的线性dp

F - 简单dpTime Limit:1000MS     Memory Limit:10000KB     64bit IO Format:%I64d & %I64uSubmit StatusDescriptionYou want to arrange the window of your flower shop in a most pleasant

2014-07-22 19:39:42 373

原创 记录路径的背包问题

H - 多重背包记录方案Time Limit:1000MS     Memory Limit:30000KB     64bit IO Format:%I64d & %I64uSubmit StatusDescriptionCharlie is a driver of Advanced Cargo Movement, Ltd. Charlie drives

2014-07-21 21:24:03 1031

原创 完全背包

G - 完全背包Time Limit:1000MS     Memory Limit:30000KB     64bit IO Format:%I64d & %I64uSubmit StatusDescriptionJohn never knew he had a grand-uncle, until he received the notary's l

2014-07-21 15:11:20 334

原创 分组背包

D - 分组背包 基础Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64uSubmit StatusDescriptionACboy has N courses this term, and he plans to spend at most M days o

2014-07-21 12:13:21 394

原创 完全背包

A - 完全背包 基础Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64uSubmit StatusDescriptionBefore ACM can do anything, a budget must be prepared and the necessa

2014-07-19 17:15:30 324

空空如也

空空如也

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

TA关注的人

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