数据结构
文章平均质量分 87
99一零七19
这个作者很懒,什么都没留下…
展开
-
G - 最小生成树模板(适合Kruskal) UVALive - 2515 Networking
G - 最小生成树模板(适合Kruskal) UVALive - 2515 You are assigned to design network connections between certain points in a wide area. You are given a set of points in the area, and a set of possible routes...原创 2018-08-09 09:13:39 · 158 阅读 · 0 评论 -
D - 演离合相遇悲喜为谁 51Nod - 1107 斜率小于0的连线数量 树状数组+离散化
D - 演离合相遇悲喜为谁 51Nod - 1107 二维平面上N个点之间共有C(n,2)条连线。求这C(n,2)条线中斜率小于0的线的数量。二维平面上的一个点,根据对应的X Y坐标可以表示为(X,Y)。例如:(2,3) (3,4) (1,5) (4,6),其中(1,5)同(2,3)(3,4)的连线斜率 < 0,因此斜率小于0的连线数量为2。Input第1行:1个数N,...原创 2018-08-18 16:56:59 · 212 阅读 · 0 评论 -
C - 染我眼角珠泪 CSU - 1770: 按钮控制彩灯实验 树状数组
C - 染我眼角珠泪 CSU - 1770 应教学安排,yy又去开心的做电学实验了。实验的内容分外的简单一串按钮通过编程了的EEPROM可以控制一串彩灯。然而选择了最low的一种一对一的控制模式,并很快按照实验指导书做完实验的yy马上感觉到十分无趣。于是他手指在一排按钮上无聊的滑来滑去,对应的彩灯也不断的变化着开关。已知每一个按钮按下会改变对应一个彩灯的状态,如此每次yy滑动都会改变一串...原创 2018-08-18 16:49:20 · 187 阅读 · 0 评论 -
B - 是你吻开笔墨 POJ - 2299 Ultra-QuickSort 逆序数 树状数组+离散化
B - 是你吻开笔墨 POJ - 2299 In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements unt...原创 2018-08-18 16:34:04 · 179 阅读 · 0 评论 -
A - 并肩行过山与水 POJ - 2352 Stars 树状数组
A - 并肩行过山与水 POJ - 2352 Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the st...原创 2018-08-18 16:28:24 · 235 阅读 · 0 评论 -
J - Chores POJ - 1949 Chores 树形DP
J - Chores POJ - 1949 Farmer John's family pitches in with the chores during milking, doing all the chores as quickly as possible. At FJ's house, some chores cannot be started until others have b...原创 2018-08-03 15:25:29 · 130 阅读 · 0 评论 -
E - Longest Regular Bracket Sequence CodeForces - 5C DP+栈
E - Longest Regular Bracket Sequence CodeForces - 5C This is yet another problem dealing with regular bracket sequences.We should remind you that a bracket sequence is called regular, if by inser...原创 2018-08-03 09:41:58 · 178 阅读 · 0 评论 -
POJ - 2492 http://poj.org/problem?id=2492
POJ - 2492 http://poj.org/problem?id=2492Background Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that they ...原创 2018-08-06 16:42:52 · 713 阅读 · 0 评论 -
E - 带删除并查集 UVA - 11987 Almost Union-Find
E - 带删除并查集 UVA - 11987 Almost Union-FindI hope you know the beautiful Union-Find structure. In this problem, you’re to implement something similar, but not identical. The data structure you need to...原创 2018-08-06 16:39:11 · 170 阅读 · 0 评论 -
最小生成树模板&&总结--Prim&&Kruskal
一.最小生成树:连通N个点的边权值总和最小的树。二.时间复杂度Prim算法:时间复杂度O(|V|2+|E|),O(|E|log|V|)Kruskal算法:时间复杂度O(|E|log|E|)算法的选择: 从图的稀疏程度考虑(稠密图Prim,稀疏图Kruskal或Prim + Heap)三.具体算法 1.Prim算法:(1) 任意选定一点s,设集合S={s} ...原创 2018-08-10 14:53:13 · 147 阅读 · 0 评论 -
I - Kruskal+一点性质 UVALive - 6837There is No Alternative
I - Kruskal+一点性质 UVALive - 6837ICPC (Isles of Coral Park City) consist of several beautiful islands. The citizens requested construction of bridges between islands to resolve inconveniences of us...原创 2018-08-10 14:46:58 · 173 阅读 · 0 评论 -
J - 最小瓶颈路 UVA - 534 Frogger
J - 最小瓶颈路 UVA - 534Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty a...原创 2018-08-10 11:26:48 · 153 阅读 · 0 评论 -
H - 最小生成树模板+1(适合Prim) UVA - 10369
H - 最小生成树模板+1(适合Prim)UVA - 10369 The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication technologies are to be use...原创 2018-08-09 09:16:03 · 178 阅读 · 0 评论 -
E - 问世间哪有更完美 HDU - 6318 逆序数 树状数组+离散化
E - 问世间哪有更完美 HDU - 6318 Long long ago, there was an integer sequence a. Tonyfang think this sequence is messy, so he will count the number of inversions in this sequence. Because he is angry, yo...原创 2018-08-18 17:09:33 · 358 阅读 · 0 评论