码迷,mamicode.com
首页 >  
搜索关键字:constructing roads    ( 767个结果
POJ2255 TreeRecovery(二叉树的三种遍历)
DescriptionLittle Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capital l...
分类:其他好文   时间:2015-11-19 14:59:21    阅读次数:113
POJ1251 Jungle Roads
解题思路:看懂题意是关键,Kruskal算法,最小生成树模板。上代码: 1 #include 2 #include 3 #include 4 using namespace std; 5 const int maxn = 80; //边的最大值 6 int A[30], n, k, vis[maxn...
分类:其他好文   时间:2015-10-26 12:00:52    阅读次数:214
Family Tree
QuestionA traditional constructing tree problem.Given a string to represent relationships, and print out number n level names.For example,Input:"Frank...
分类:其他好文   时间:2015-10-15 06:23:19    阅读次数:164
CF 191C Fools and Roads lca 或者 树链剖分
They say that Berland has exactly two problems, fools and roads. Besides, Berland hasncities, populated by the fools and connected by the roads. All B...
分类:其他好文   时间:2015-10-13 13:39:51    阅读次数:236
UvaLive 5026 Building Roads
传送门Time Limit: 3000MSDescriptionThere is a magic planet in the space. There is a magical country on the planet. There are N cities in the country. The...
分类:其他好文   时间:2015-10-13 10:25:09    阅读次数:220
Codeforces Round #323 (Div. 2)
被进爷坑了,第二天的比赛改到了12点水A - Asphalting Roads/************************************************* Author :Running_Time* Created Time :2015/10/3 星期六 21...
分类:其他好文   时间:2015-10-06 22:04:00    阅读次数:230
UVA 10308 Roads in the North
一颗全连通且只有一条路从一个顶点到达另一个顶点,直接深搜,返回时返回最远的支路,且最远的支路加上第二远的支路和总路途最远比较,更新总路途最大,因为以一个点为中心走很多条路,最远的肯定是最大两条路的和,做法类似dp 输入有点坑,输完最后一组数据直接EOF,处理输入搞了好久,gets返回的是指针,...
分类:其他好文   时间:2015-10-05 11:31:28    阅读次数:228
Codeforces 583 DIV2 Asphalting Roads 模拟
原题链接:http://codeforces.com/problemset/problem/583/A题意:很迷很迷,表示没看懂。。但是你看样例就秒懂了题解:照着样例模拟就好代码:#include#include#include#define MAX_N 55using namespace std;...
分类:Web程序   时间:2015-10-04 20:47:58    阅读次数:245
POJ 2421 Constructing Roads
题意:要在n个城市之间建造公路,使城市之间能互相联通,告诉每个城市之间建公路的费用,和已经建好的公路,求最小费用。解法:最小生成树。先把已经建好的边加进去再跑kruskal或者prim什么的。代码:#include#include#include#include#include#include#in...
分类:其他好文   时间:2015-10-02 23:49:16    阅读次数:362
POJ 1251 Jungle Roads
题意:嗯……没看题……看了眼图……求个最小生成树。解法:kruskal。代码:#include#include#include#include#include#include#include#include#include#include#include#include#include#includ...
分类:其他好文   时间:2015-10-02 23:44:43    阅读次数:213
767条   上一页 1 ... 41 42 43 44 45 ... 77 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!