码迷,mamicode.com
首页 >  
搜索关键字:jungle roads    ( 729个结果
杭电ACM1025——Constructing Roads In JGShining's Kingdom
题目的意思是,两行城市,从左到右为1,2,3……n个城市。上面的下面的城市要与上面某个的城市相连,在不出现相交的情况下,最多可以连多少条。 知道了题意,就知道了应该用DP来做。 这一题,数据量比较大,用普通的DP,时间复杂度为N^2,会超时,我们应该用另一种DP方法,时间复杂度为nlogn。 nlogn的DP的思路大概就是给你一个数,插到一个数组中,该位置已存在,就覆盖它。也就是可以用二分查...
分类:其他好文   时间:2015-05-04 10:08:50    阅读次数:173
hdoj 1102 Constructing Roads
并查集+最小生成树Constructing RoadsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15844Accepted Submissio...
分类:其他好文   时间:2015-05-01 13:18:27    阅读次数:108
poj1947Rebuilding Roads(树形dp)
题目:poj1949Rebuilding Roads 题意:给出一棵树,问现在要得到一颗有p个节点的子树,需要最少减掉几条边?分析: 首先可以明确是一个树形dp题目,状态也很好定义: dp【root】【j】:以root为根节点的子树,得到 j 个节点的子树需要最少减掉的边数,注意子树中必须保留root节点。否则无法dp 那么很明显的边界条件dp【root】【1】 = num(儿子的个数),因...
分类:其他好文   时间:2015-04-30 20:09:00    阅读次数:135
UVA - 10308 - Roads in the North (DFS)
题目传送:UVA - 10308 思路:就是树的遍历,DFS即可,注意输入 AC代码: #include #include #include #include #include #include #include #include #include #include #include #include #include #include #defi...
分类:其他好文   时间:2015-04-30 08:54:31    阅读次数:105
【HDOJ】2988 Dark roads
最小生成树。 1 /* */ 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 ...
分类:其他好文   时间:2015-04-29 00:23:39    阅读次数:175
POJ 2431Expedition
DescriptionA group of cows grabbed a truck and ventured on an expedition deep into the jungle. Being rather poor drivers, the cows unfortunately manag...
分类:其他好文   时间:2015-04-28 09:29:00    阅读次数:83
hdu 3018 Ant Trip 算是一道欧拉通路的题目吧~
Problem Description Ant Country consist of N towns.There are M roads connecting the towns. Ant Tony,together with his friends,wants to go through every part of the country. They intend to visit every road , and every road must be visited for exact one t...
分类:其他好文   时间:2015-04-27 13:22:54    阅读次数:148
HDU 1102 Constructing Roads (最小生成树+Kruskal算法入门)
【题目链接】:click here~~ 【题目大意】:已知某几条道路已经修完,求全部道路要通路的最小花费 【解题思路】:基础的Kruskal算法了,按照边的权值从小到大排序一遍,符合条件加入到生成树中 代码: /* Author:HRW kruskal+并查集 */ #include using namespace std; const int max_v=105; const int...
分类:编程语言   时间:2015-04-25 10:45:48    阅读次数:208
HDU 1025 Constructing Roads In JGShining's Kingdom   LIS 简单题 好题 超级坑
Constructing Roads In JGShining's KingdomProblem DescriptionJGShining's kingdom consists of 2n(n is no more than 500,000) small cities which are...
分类:其他好文   时间:2015-04-24 00:57:02    阅读次数:154
POJ 3067 Japan(树状数组/求逆序数)
Japan Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 22258   Accepted: 5995 Description Japan plans to welcome the ACM ICPC World Finals and a lot of roads ...
分类:编程语言   时间:2015-04-21 22:46:39    阅读次数:182
729条   上一页 1 ... 51 52 53 54 55 ... 73 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!