自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 寒假集训 数据结构 M Daunting device(分块)

题目链接正解#include <bits/stdc++.h>using namespace std;typedef long long ll;#define rep(i,a,b) for(int i=a;i<=b;i++)#define per(i,a,b) for(int i=a;i><=b;i--)const int mm=1e5+10;int ...

2020-01-18 10:31:52 170

转载 运算符重载详解(杂谈)

Angel_Kitty我很弱,但是我要坚强!绝不让那些为我付出过的人失望!</div><!--end: blogTitle 博客的标题和副标题 --><div id="navigator">博客园首页新随笔联系订阅管理 <div ...

2020-01-13 15:25:40 1135

转载 某位ACMer过来人的心得

刻苦的训练我打算最后稍微提一下。主要说后者:什么是有效地训练?我想说下我的理解。很多ACMer入门的时候,都被告知:要多做题,做个500多道就变牛了。其实,这既不是充分条件、也不会是必要条件。我觉得一般情况下,对于我们普通学校的大学生,各方面能力的差距不会太大,在这种情况下,训练和学习的方法尤为重要。其实,500题仅仅是一个标志,而且仅仅表示你做ACM-ICPC有一定的时间,我们训练的目...

2020-01-07 20:28:57 195

原创 HDU2196 Computer(树形dp)

题目链接题意在n个结点的树中,边有权值,找到每个结点到最远的结点的距离解法有两种解法,一种是利用树的直径,另一种是树形dp我的做法是树形dp的。对于一个节点i来说,他最长的距离可以是向它的子树方向走,也可以向父节走,如果向父节点走还有可能向父节点的子树走,因此需要注意的是父节点的子树包含了自己的子树,父节点有两种情况,父节点最长的路径没有经过i点和经过i点,没有经过i点则直接加上i到...

2020-01-07 19:33:45 85

原创 POJ 3107 Godfather (树形dp树的重心)

题目传送门题意有n个结点组成的无根树,找到树的重心。思路树的重心一棵树的重心:在于重心相连的子树中节点最多的子树是与所有结点相连的子树中节点最多的子树的最小值例如下面的树,结点一的子树可以分成三个,其中最大的子树有3个结点,是所有结点最大子树中最小的,所以结点1是一个重心如果拿6来说,它的子树中最大的子树有5个结点并不是最小的重心解释完了,就是用bfs遍历树,在遍历的时候计算每个...

2020-01-07 11:04:36 126

原创 CodeForces148D Bag of mice(概率dp)

Bag of miceThe dragon and the princess are arguing about what to do on the New Year’s Eve. The dragon suggests flying to the mountains to watch fairies dancing in the moonlight, while the princess th...

2020-01-06 21:15:29 92

原创 HDU4405 Aeroplane chess(期望dp)

区间dp

2020-01-06 21:01:24 74

原创 Discovering Gold(期望dp)

题目链接You are in a cave, a long cave! The cave can be represented by a 1 x N grid. Each cell of the cave can contain any amount of gold.Initially you are in position 1. Now each turn you throw a perfe...

2020-01-06 20:52:12 118

原创 Halloween Costumes (区间dp)

题目题目链接Gappu has a very busy weekend ahead of him. Because, next weekend is Halloween, and he is planning to attend as many parties as he can. Since it’s Halloween, these parties are all costume part...

2020-01-06 20:40:04 182

原创 Hdu 4632 Palindrome subsequence(区间dp)

题目In mathematics, a subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements. For example, the sequence <A...

2020-01-06 20:20:36 66

原创 Brackets(区间dp)

题目We give the following inductive definition of a “regular brackets” sequence:the empty sequence is a regular brackets sequence,if s is a regular brackets sequence, then (s) and [s] are regular bra...

2020-01-06 20:12:16 69

原创 Network of Schools(tarjan)

Network of SchoolsA number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it distributes software...

2019-11-08 16:42:31 120

转载 维护数列(splay)

维护数列(splay)转载保存问题解析做题思路预备首先,要有一点splay维护区间操作的基础。splay维护区间的基本原理,就是将区间[l,r]的端点l-1,和r+1不断的通过伸展操作即splay到根,将l-1伸展到根,将r+1伸展到根的右儿子,那么[l,r]这段区间就在根的右儿子的左儿子上了。特别要注意的是,这里的l,r不是给出的区间端点的编号,而是我们在平衡树的中序遍历中区间端点的...

2019-07-20 10:11:44 315

转载 01背包-Dividing-Big Event in HDU-Cow Exhibition(代价为负值的背包)

DividingMarsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy if all the marbles had t...

2019-07-08 23:57:33 78

转载 最大连续子序列和

Max SumGiven a sequence a[1],a[2],a[3]…a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 = 14.InputThe...

2019-07-08 23:41:04 57

空空如也

空空如也

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

TA关注的人

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