![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM--图论
Lila_老妖
爱与和平.
展开
-
Ikki's Story IV - Panda's Trick
Ikki's Story IV - Panda's TrickTime Limit: 1000MS Memory Limit: 131072KTotal Submissions: 7821 Accepted: 2892Descriptionliympanda, one of Ikki’s friend, likes playing games with Ikki. Today af原创 2016-11-25 21:24:06 · 398 阅读 · 0 评论 -
迪杰斯特拉
迪杰斯特拉(大神链接):点击打开链接其基本思想是,设置顶点集合S并不断地作贪心选择来扩充这个集合。一个顶点属于集合S当且仅当从源到该顶点的最短路径长度已知。初始时,S中仅含有源。设u是G的某一个顶点,把从源到u且中间只经过S中顶点的路称为从源到u的特殊路径,并用数组dist记录当前每个顶点所对应的最短特殊路径长度。Dijkstra算法每次从V-S中取出具有最短特殊路长度的顶点u,将u添原创 2017-04-19 10:48:30 · 405 阅读 · 0 评论 -
畅通工程续
畅通工程续Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 21028 Accepted Submission(s): 7310Problem Description某省自从实行了很多年的畅通工程计划后,终于修建了原创 2017-04-16 19:50:32 · 261 阅读 · 0 评论 -
Dungeon Master
Dungeon Master You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one原创 2017-04-16 19:55:11 · 249 阅读 · 0 评论 -
二叉树--AVL树
AVL TreeTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 642 Accepted Submission(s): 310Problem DescriptionAn AVL tree is a kind of balanced b...原创 2017-12-22 20:33:26 · 486 阅读 · 0 评论 -
B - Tree Recovery POJ - 2255 (二叉树)
B - Tree RecoveryPOJ - 2255 Little Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capital letters in the nodes.This is an ex...原创 2017-04-06 15:11:37 · 305 阅读 · 0 评论 -
线段树详解
很用心写的这篇博客,反正是花了好几天。前言:要在自然数,且所有的数不大于30000的范围内讨论一个问题:现在已知n条线段,把端点依次输入告诉你,然后有m个(多次)询问,每个询问输入一个点,要求这个点在多少条线段上出现过;最暴力的解法当然就是读一个点,就把所有线段比一下,看看在不在线段中;但是每次询问都要把n条线段查一次,那么m次询问,就要运算m*n次,复杂度就是O(m*n)假如m是30000,那么...原创 2017-06-05 20:51:11 · 562 阅读 · 0 评论 -
I Hate It(hdu 1754)线段树
I Hate It题目链接:点击打开链接Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 74300 Accepted Submission(s): 28675Problem Description很多学校流行一种比较的习惯。老师们很喜...原创 2017-05-04 16:20:24 · 318 阅读 · 0 评论 -
敌兵布阵(线段树)hdu 1166
hdu 1166题目链接:点击打开链接敌兵布阵Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 87939 Accepted Submission(s): 37022Problem DescriptionC国的死对头A国这段时间正在进...原创 2017-05-04 14:27:31 · 235 阅读 · 0 评论 -
最短路-佛罗伊德
最短路Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 57858 Accepted Submission(s): 25500Problem Description在每年的校赛里,所有进入决赛的同原创 2016-12-25 17:35:10 · 470 阅读 · 0 评论 -
Arbitrage(hdu 1217 最短路)
ArbitrageHDU - 1217 Arbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that 1 US Do...原创 2017-04-06 16:04:17 · 329 阅读 · 0 评论 -
Til the Cows Come Home(POJ 2387)
Til the Cows Come Home(POJ 2387)Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 51512 Accepted: 17411DescriptionBessie is out in the field and wants to get back to the barn to ge原创 2017-04-18 21:38:54 · 202 阅读 · 0 评论 -
poj --1125----Stockbroker Grapevine(多源最短路径)
Stockbroker GrapevineTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 34975 Accepted: 19417DescriptionStockbrokers are known to overreact to rumours. You have been contracted to d原创 2016-12-29 10:45:58 · 406 阅读 · 0 评论 -
无根树转为有根树-vector
输入一个n个结点的无根树的各条边,并指定一个根结点,要求把该树转化为有根树,输出各个结点的父节点编号。n<=10^6. //输入无根树的结点个数n,输入n-1条边(u, v),输入欲指定的根的编号root,建立以root为根的树 /*可变长数组 一个有maxn行 当时每行长度可以不同的数组 用于表示树中结点间的关系 */主程序中设置p[root]=-1(表示根结点不存在),然...原创 2017-02-24 13:12:45 · 1573 阅读 · 0 评论 -
HDU --1874畅通工程续
畅通工程续Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 50210 Accepted Submission(s): 18728Problem Description某省自从实行了很多年的畅通工原创 2017-03-05 19:42:26 · 227 阅读 · 0 评论 -
hdu--Arbitrage(最短路)
ArbitrageTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7630 Accepted Submission(s): 3537Problem DescriptionArbitrage is原创 2017-03-10 13:57:22 · 238 阅读 · 0 评论 -
hdu---2112(迪杰斯特拉)
HDU TodayTime Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 27455 Accepted Submission(s): 6696Problem Description经过锦囊相助,海东集原创 2017-03-10 21:31:41 · 206 阅读 · 0 评论 -
hdu-2544-最短路(图论)
最短路Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 57858 Accepted Submission(s): 25500Problem Description在每年的校赛里,所有进入决赛的同原创 2016-12-24 11:41:38 · 299 阅读 · 0 评论 -
Bakery
Bakery Masha wants to open her own bakery and bake muffins in one of the n cities numbered from 1 to n. There are m bidirectional roads, each of whose connects some pair of cities.To bake muff原创 2017-03-11 17:24:15 · 407 阅读 · 0 评论 -
F - Minimum Transport Cost(最短路)
F - Minimum Transport Cost HDU - 1385 These are N cities in Spring country. Between each pair of cities there may be one transportation track or none. Now there is so...原创 2017-03-29 11:54:27 · 333 阅读 · 0 评论 -
Frogger(最短路)
FroggerTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 42402 Accepted: 13535DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sittin...原创 2017-04-06 15:46:05 · 342 阅读 · 0 评论 -
树的高度
现在有一棵合法的二叉树,树的节点都是用数字表示,现在给定这棵树上所有的父子关系,求这棵树的高度输入描述:输入的第一行表示节点的个数n(1 ≤ n ≤ 1000,节点的编号为0到n-1)组成,下面是n-1行,每行有两个整数,第一个数表示父节点的编号,第二个数表示子节点的编号输出描述:输出树的高度,为一个整数示例1输入50 10 21 31 4输出3#include<iostream...原创 2018-05-02 16:07:53 · 223 阅读 · 0 评论