自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

creator平

To remember to let go and to move on.

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

原创 hdu 6115 Factory (LCA在线+暴力 水过)

我们将A省简化为由N个城市组成,某些城市之间存在双向道路,而且A省的交通有一个特点就是任意两个城市之间都能通过道路相互到达,且在不重复经过城市的情况下任意两个城市之间的到达方案都是唯一的。聪明的你一定已经发现,这些城市构成了树这样一个结构。现在百度陆续开了许许多多的子公司。每家子公司又会在各城市中不断兴建属于该子公司的办公室。由于各个子公司之间经常有资源的流动,所以公司员工常常想知道,两家子公...

2018-11-30 19:18:11 162

原创 POJ 1986 Distance Queries (LCA离线)

Farmer John's cows refused to run in his marathon since he chose a path much too long for their leisurely lifestyle. He therefore wants to find a path of a more reasonable length. The input to this pr...

2018-11-29 22:02:31 132

原创 ZOJ 2588 Burning Bridges (求桥)

Ferry Kingdom is a nice little country located on N islands that are connected by M bridges. All bridges are very beautiful and are loved by everyone in the kingdom. Of course, the system of bridges i...

2018-11-29 08:28:13 122

原创 poj 1330 Nearest Common Ancestors (LCA入门)

A rooted tree is a well-known data structure in computer science and engineering. An example is shown below:In the figure, each node is labeled with an integer from {1, 2,...,16}. Node 8 is the root ...

2018-11-28 20:20:24 98

原创 hdu 2586 How far away ? (tarjan离线LCA算法)

There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this "How far is it if I want to go from house A to house B"? Usually it hard to...

2018-11-28 19:29:48 190

原创 hdu 4547 CD操作 (tarjan离线LCA算法)

  在Windows下我们可以通过cmd运行DOS的部分功能,其中CD是一条很有意思的命令,通过CD操作,我们可以改变当前目录。  这里我们简化一下问题,假设只有一个根目录,CD操作也只有两种方式:    1. CD 当前目录名\...\目标目录名 (中间可以包含若干目录,保证目标目录通过绝对路径可达)  2. CD .. (返回当前目录的上级目录)    现在给出当前目录和一个目标目...

2018-11-27 20:56:56 208

原创 poj 1470 Closest Common Ancestors (LCA)

Write a program that takes as input a rooted tree and a list of pairs of vertices. For each pair (u,v) the program determines the closest common ancestor of u and v in the tree. The closest common anc...

2018-11-24 16:20:57 108

原创 POJ 1523 SPF (求割点及子图个数)

Consider the two networks shown below. Assuming that data moves around these networks only between directly connected nodes on a peer-to-peer basis, a failure of a single node, 3, in the network on th...

2018-11-24 10:41:58 148

原创 hdu-1561 The more, The Better (树上背包)

ACboy很喜欢玩一种战略游戏,在一个地图上,有N座城堡,每座城堡都有一定的宝物,在每次游戏中ACboy允许攻克M个城堡并获得里面的宝物。但由于地理位置原因,有些城堡不能直接攻克,要攻克这些城堡必须先攻克其他某一个特定的城堡。你能帮ACboy算出要获得尽量多的宝物应该攻克哪M个城堡吗?Input每个测试实例首先包括2个整数,N,M.(1 <= M <= N <= 200)...

2018-11-21 20:03:22 94

原创 hdu 2196 Computer

A school bought the first computer some time ago(so this computer's id is 1). During the recent years the school bought N-1 new computers. Each new computer was connected to one of settled earlier. Ma...

2018-11-19 20:53:54 120

原创 HDU - 1054 Strategic Game (树型DP)

Bob enjoys playing computer games, especially strategic games, but sometimes he cannot find the solution fast enough and then he is very sad. Now he has the following problem. He must defend a medieva...

2018-11-17 11:40:26 180

原创 POJ 2342 Anniversary party (树形dp入门)

There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees. It means that the supervisor relation forms a tr...

2018-11-16 20:33:38 98

原创 HDU 4738 Caocao's Bridges (桥的权最小)

Caocao was defeated by Zhuge Liang and Zhou Yu in the battle of Chibi. But he wouldn't give up. Caocao's army still was not good at water battles, so he came up with another idea. He built many island...

2018-11-16 13:44:21 152

原创 hdu 4685 Prince and Princess (二分图匹配+tarjan)

There are n princes and m princesses. Princess can marry any prince. But prince can only marry the princess they DO love.For all princes,give all the princesses that they love. So, there is a maximum...

2018-11-16 11:00:46 133

原创 POJ - 1904 King's Quest (tarjan)

Once upon a time there lived a king and he had N sons. And there were N beautiful girls in the kingdom and the king knew about each of his sons which of those girls he did like. The sons of the king w...

2018-11-15 20:25:33 111

原创 HDU - 4635 Strongly connected

Give a simple directed graph with N nodes and M edges. Please tell me the maximum number of the edges you can add that the graph is still a simple directed graph. Also, after you add these edges, this...

2018-11-14 21:13:32 195

原创 hdu 4612 Warm up (tarjan+dfs)

  N planets are connected by M bidirectional channels that allow instant transportation. It's always possible to travel between any two planets through these channels.  If we can isolate some planets...

2018-11-14 17:22:49 176

原创 POJ 3177 Redundant Paths (tarjan+缩点)

In order to get from one of the F (1 <= F <= 5,000) grazing fields (which are numbered 1..F) to another field, Bessie and the rest of the herd are forced to cross near the Tree of Rotten Apples....

2018-11-13 20:33:29 136

原创 POJ3694 Network (LCA+tarjan+并查集)

A network administrator manages a large network. The network consists of N computers and M links between pairs of computers. Any pair of computers are connected directly or indirectly by successive li...

2018-11-13 15:53:11 260

原创 UVA 796-Critical Links (求桥)

In a computer network a link L, which interconnects two servers, is considered critical if there are at least two servers A and B such that all network interconnection paths between A and B pass throu...

2018-11-10 11:35:14 217

原创 poj1144-Network (求割点)

A Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places numbered by integers from 1 to N. No two places have the same number. The lines are bid...

2018-11-09 17:14:31 149

原创 算法文章推荐

大数a-b:https://blog.csdn.net/liusu201601/article/details/83054406无向图割点求法:https://blog.csdn.net/zsyz_ZZY/article/details/79907335 https://www.cnblogs.com/en-heng/p/4002658.h...

2018-11-09 08:55:58 570

原创 POJ 1236——Network of Schools(强连通)

A 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 (the “receiving sc...

2018-11-08 12:46:54 145

原创 神秘钥匙 (规律题)

 题目描述clccle一行

2018-11-07 08:48:19 451

原创 ZOJ - 3469-Food Delivery (区间DP)

When we are focusing on solving problems, we usually prefer to stay in front of computers rather than go out for lunch. At this time, we may call for food delivery.Suppose there are N people living ...

2018-11-06 14:06:40 153

原创 nyoj1505-咋暴力啊

题目描述:给出一行n个整数,第i个整数为A[i],求(A[i] - A[j])/ (i-j) 最大2 <= n <= 10000,-10^9 <= A[i] <= 10^9   输入描述:数据有多组(不超过100组)每组第一行给出一个整数n接下来一行n个整数之间用空格隔开输出描述:每组数据输出一个浮点数保留两位小数,表示需要求得的最大值...

2018-11-03 21:02:56 171

原创 回文日期

 题目描述众所周知,小K是nowcoder的暴政苟管理,所以小K很擅长踢树,虽然本题与踢树无关小K喜欢将日期排列成yyyy-mm-dd的形式(位数不足添零补齐)的形式,虽然这与小K只会做回文字符串这道水题无关,但小K觉得日期组成的回文串也是挺可爱的。作为一个凉心出题人,小K决定给你一个可爱的问题:给你两个日期,求这两个日期的闭区间内有多少个回文的日期(输入可能包含多组数据)输入描述...

2018-11-02 21:03:38 471

原创 POJ - 1651 Multiplication Puzzle (区间DP)

The multiplication puzzle is played with a row of cards, each containing a single positive integer. During the move player takes one card out of the row and scores the number of points equal to the pr...

2018-11-01 21:07:23 99

原创 CodeForces - 149D Coloring Brackets (区间DP+DFS)

Once Petya read a problem about a bracket sequence. He gave it much thought but didn't find a solution. Today you will face it.You are given string s. It represents a correct bracket sequence. A cor...

2018-11-01 20:42:59 203

空空如也

空空如也

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

TA关注的人

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