HDU 1301 Jungle Roads——————最小生成树

『杭电1301』Jungle Roads Problem Description The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But the jungle overtakes roads relentlessly, so the large road network is too 阅读详情

Jungle Roads

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 10014    Accepted Submission(s): 7340


Problem Description

这里写图片描述>

The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But the jungle overtakes roads relentlessly, so the large road network is too expensive to maintain. The Council of Elders must choose to stop maintaining some roads. The map above on the left shows all the roads in use now and the cost in aacms per month to maintain them. Of course there needs to be some way to get between all the villages on maintained roads, even if the route is not as short as before. The Chief Elder would like to tell the Council of Elders what would be the smallest amount they could spend in aacms per month to maintain roads that would connect all the villages. The villages are labeled A through I in the maps above. The map on the right shows the roads that could be maintained most cheaply, for 216 aacms per month. Your task is to write a program that will solve such problems.

The input consists of one to 100 data sets, followed by a final line containing only 0. Each data set starts with a line containing only a number n, which is the number of villages, 1 < n < 27, and the villages are labeled with the first n letters of the alphabet, capitalized. Each data set is completed with n-1 lines that start with village labels in alphabetical order. There is no line for the last village. Each line for a village starts with the village label followed by a number, k, of roads from this village to villages with labels later in the alphabet. If k is greater than 0, the line continues with data for each of the k roads. The data for each road is the village label for the other end of the road followed by the monthly maintenance cost in aacms for the road. Maintenance costs will be positive integers less than 100. All data fields in the row are separated by single blanks. The road network will always allow travel between all the villages. The network will never have more than 75 roads. No village will have more than 15 roads going to other villages (before or after in the alphabet). In the sample input below, the first data set goes with the map above.

The output is one integer per line for each data set: the minimum cost in aacms per month to maintain a road system that connect all the villages. Caution: A brute force solution that examines every possible set of roads will not finish within the one minute time limit.
 

Sample Input
  
9
A 2 B 12 I 25
B 3 C 10 H 40 I 8
C 2 D 18 G 55
D 1 E 44
E 2 F 60 G 38
F 0
G 1 H 35
H 1 I 35
3
A 2 B 10 C 40
B 1 C 20
0
 

Sample Output
  
216
30
 

Source
 

Recommend
Eddy  &nbsp|  &nbspWe have carefully selected several similar problems for you:   1162  1102  1217  1142  1879 
 

Statistic |  Submit |  Discuss | Note









Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2018 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao&nbspLinLe&nbspGaoJie&nbspGanLu
Total 0.000000(s) query 5, Server time : 2018-08-16 22:28:09, Gzip enabled



题意杀。

//#include<bits/stdc++.h>
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
const int MAXN=100;
int n,m,pre[MAXN];
struct Edge{
    int x,y,dis;
    Edge(){}
    Edge(int _x,int _y,int _dis)
    {
        x=_x; y=_y; dis=_dis;
    }
};
bool cmp(Edge a,Edge b)
{
    return a.dis<b.dis;
}
void init()
{
    for(int i=0;i<=n;i++)
        pre[i]=i;
}
int find(int x)
{
    return pre[x]==x?x:pre[x]=find(pre[x]);
}
bool join(int x,int y)
{
    x=find(x);
    y=find(y);
    if(x!=y)
    {
        pre[x]=y;
        return true;
    }
    return false;
}

vector<Edge> d;
int main()
{
    while(~scanf("%d",&n)&&n)
    {
        init();
        d.clear();
        int x,y,z;
        char ch1,ch2;
        for(int i=0;i<n-1;i++)
        {
            getchar();
            scanf("%c %d",&ch1,&m);
            x=ch1-'A';
            for(int j=0;j<m;j++)
            {
                getchar();
                scanf("%c %d",&ch2,&z);
                y=ch2-'A';
                d.push_back(Edge(x,y,z));
            }
        }
        sort(d.begin(),d.end(),cmp);
        int cnt=0,ans=0;
        for(int i=0;i<d.size();i++)
        {
            Edge e=d[i];
            if(join(e.x,e.y))
            {
                ans+=e.dis;
                cnt++;
            }
            if(cnt==n-1)    break;
        }
        printf("%d\n",ans);

    }
    return 0;
}









【鸿蒙实战开发】HarmonyOS申请调试签名证书过程 这份鸿蒙(HarmonyOS NEXT)资料包含了鸿蒙开发必掌握的核心知识要点,内容包含了(ArkTS、ArkUI开发组件、Stage模型、多端部署、分布式应用开发、音频、视频、WebGL、OpenHarmony多媒体技术、Napi组件、OpenHarmony内核、Harmony南向开发、鸿蒙项目实战等等)鸿蒙(HarmonyOS NEXT)技术知识点。 阅读详情

相关推荐

qPCRtools | 神仙R包分分钟搞定你的qPCR实验结果!~

1写在前面 不知道大家都是怎么完成qPCR的计算的,在不会R的时候,我是用一个祖传的Excel表进行计算的。🤣 但是,一直有个缺点,如果需要计算的量比较大时,就不方便了,去搜了一下文献,发现了一个最近发表的R包,不仅可以计算反转录的RNA体积,还可以帮助选择定量方法,简直是神仙R包,本期就介绍一下它的使用吧。🥰 感谢原作者的开发,嘿嘿,文末有引用方法。👀 2用到的包 rm(list = ls())library(tidyverse)library(ggsci)library(qPCRtools)librar

m0_72224305的博客 3986

杭电1301--Jungle Roads(最小生成树)

Jungle Roads Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5379Accepted Submission(s): 3884 Problem Description The Head Elder of t...

weixin_34032792的博客 154

【无标题】

可以看到这是一个带过滤的rce,并且还需要绕过空格,通过·查询资料得到了${IFS},$IFS$9,<,$IFS。然后f,l,a,g都被过滤了,可以用中括号[]来进行正则匹配,把GET传的参数改为?cmd=uniq /[e-h][k-n][^-b][e-h],就得到了flag。cmd={%0A"cmd":"/bin/cat /home/rceservice/flag"%0A}可以看到l被过滤了ls用不了了可以用dir用GET传参cmd=dir /,POST传参shell=system。

2501_94507425的博客 303

杭电1301Jungle Roads

Jungle Roads Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5421    Accepted Submission(s): 3909 Problem Description The Head

hpuzsk的博客 707

数通基础(基本网络通信原理、IP地址如何配置、DHCP、DNS域名系统、路由技术基础、静态路由 、TCP和UDP、vlan虚拟局域网、trunk、三层交换)

我们知道了1、电脑开机,通过dhcp获取ip地址2、电脑输入域名,www.baidu.com电脑把www.baidu.com发到自己的dns服务器3、dns服务器把域名解析成对应的ip地址4、电脑向百度服务器发送一个请求。

qq_53235556的博客 6477

保姆级教程:在RK3588 Android12设备树(DTS)中配置MIPI 8 Lane双通道与DSC显示

本文详细介绍了在RK3588 Android12平台上配置MIPI 8 Lane双通道与DSC显示的实战指南。通过设备树(DTS)参数详解、DSC参数计算与PPS配置、双通道同步机制实现等内容,帮助开发者高效完成高分辨率屏幕驱动配置,解决嵌入式显示系统开发中的常见挑战。

weixin_30905133的博客 399

HDU 1301 Jungle Roads (最小生成树)kruskal

Jungle Roads Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4260 Accepted Submission(s): 3114 Problem Description The Head Elder of the

TIMELIMITE的专栏 591

KiCad插件安装太慢?试试华秋版,再手把手教你装这5个实用插件

本文介绍了KiCad华秋发行版如何解决插件安装慢的问题,并详细推荐了5个实用插件及其安装方法。华秋版优化了国内用户的下载速度,预装了常用扩展包,包括BOM生成器、3D模型增强工具等,显著提升PCB设计效率。

weixin_29184075的博客 547

hdu1102 Constructing Roads(两种基础最小生成树算法)

http://acm.hdu.edu.cn/showproblem.php?pid=1102 题意:n个村庄,给你一个矩阵代表村庄i到j的距离,求要想使所有村庄连通需要修多少长度的路。 思路:基础MST。已经给你的道路相当于这两点已经可达,那么这两点之间就不用修路,赋长度为0,对边方向性的操作同hdu1233。这一点要想清楚,不得不说图论里有些想法真的好神奇。 #in

Iguodala的博客 469

深入解析Android Qcom Camera HAL3架构与Camx线程模块

本文深入解析了Android Qcom Camera HAL3架构与Camx线程模块的核心原理。文章以高通芯片平台为例,剖析了从按下快门到生成照片的完整Camera流程分析,重点阐述了Camx框架中线程池、消息队列及Fence同步机制如何协同工作,以实现高效、稳定的多线程并发图像处理,为相机性能优化提供理论基础。

weixin_29184075的博客 220

SAP-MM-供应商对账平台(功能集合)

(1)集成OA审批,线上核销,结果写入SAP; (2)集成SRM,线上与供应商对账确认,写入SAP; (3)集成财务付款结果确认写入,OA回传结果,定时同步SRM供应商平台。 欢迎留言交流,功能完善,如需要页面设计,请订阅专栏

qq_32198063的博客 748

HDU 1301 Jungle Roads(裸最小生成树)

题目链接 今天做了好几个模版最小生成树。。。贴一个kurskral. 1 /* 2 HDU 1301 Jungle Roads 3 最小生成树Kurskal模版 4 */ 5 #include <stdio.h> 6 #include <string.h> 7 #include <stdlib.h> 8 int num,su...

weixin_30535913的博客 92

交换机端口模式详解:Access、Hybrid、Trunk

交换机是网络中至关重要的组件之一,用于连接各种设备并启用数据的高效流动。为了更好地管理和控制网络流量,交换机提供了不同的端口模式,其中包括Access、Hybrid和Trunk。本文将深入探讨这三种端口模式,详细解释它们的配置、特性和应用场景,以帮助网络管理员更好地理解和优化网络架构。

网络技术联盟站 4015

hdu 1301 Jungle Roads (最小生成树)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1301 思路: 题目看起来极其吓人= =!其实就是一个裸的最小生成树,把字母对应数字就可以了。 #include #include #include #include #include #include #include #include #include #include #include #i

Where amazing happens 432

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

hdu1301——Jungle Roads——最小生成树

简单地最小生成树,一A The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But the jungle overtakes roads relentlessly, so the large road network is too expensive to

WAR___NING的专栏 793

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

Jungle Roads HDU - 1301 最小生成树

求地图中的最小生成树。 多组输入。每个数据第一行为图中点的个数。紧接着n-1行,每行的第一个字母为图中的某一个点,(按照字典序升序),第二个数字表示这个点与比它字典序大的相连点的个数,然后后面紧接着为相连边的情况。 当地图中点的个数为0时,输入结束。 Input 9 A 2 B 12 I 25 B 3 C 10 H 40 I 8 C 2 D 18 G 55 D 1 E 44 E 2 F 60 G 38 F 0 G 1 H 35 H 1 I 35 3 A 2 B 10 C 40 B 1 C 20 0 Out.

qq_45891413的博客 239

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Jungle Roads - HDU 1301 - 最小生成树

Jungle Roads - HDU 1301 - 最小生成树  这道题和Jungle Roads - POJ 1251 - Virtual Judge完全是一道题,直接把代码复制粘贴一遍就可以了。当时被作为Kruskal算法的例题。  代码传送门:Kruskal算法简明

LucienShui 667

【最小生成树-Kruskal】HDU 1301 Jungle Roads

Jungle Roads #include <iostream> #include <cstdio> #include <algorithm> #include <queue> #include <cmath> #include <cstring> #include <string> #include <ve...

L_X_ 208

hdu1301 Jungle Roads 【最小生成树】

Jungle Roads Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5421    Accepted Submission(s): 3909 Problem Description The Head El

qingkong5886的博客 367

hdu1301:Jungle Roads(最小生成树)

http://acm.hdu.edu.cn/showproblem.php?pid=1301 Problem Description The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads betwe...

358

Hdu 1301 Jungle Roads (最小生成树)

地址:http://acm.hdu.edu.cn/showproblem.php?pid=1301 很明显,这是一道“赤裸裸”的最小生成树的问题; 我这里采用了Kruskal算法,当然用Prim算法也一样可以解题。 #include <iostream> #include <cstring> #include <cstdio>...

weixin_30865427的博客 97

HDU1301 Jungle Roads 【最小生成树Prim】

Jungle Roads Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4268    Accepted Submission(s): 3120 Problem Description The Head

长风的专栏 2347

HDU 1301 Jungle Roads【最小生成树,prim】

点击打开链接 题意:  给你n的城市,然后给你城市间的距离,让你花最小的代价,连通。 题解: 最小生成树 ,快结束才A 的,刚开始我看着题,坑爹的图片没显示,我就没看懂。最后突然看见好多人过了。。赶紧看看,发现了图。。。。 还有一点,就是敲prim  ,里面的括号扩错地方,,,,,,让我郁闷半天,,, #include #include #include u

zoro_n的博客 280

HDU1301 Jungle Roads(最小生成树)

Jungle Roads HERE Description The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But the jungle o...

qq_45739382的博客 214

HDU——1301 Jungle Roads(最小生成树问题)

原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1301 样例: Sample Input 9 A 2 B 12 I 25 B 3 C 10 H 40 I 8 C 2 D 18 G 55 D 1 E 44 E 2 F 60 G 38 F 0 G 1 H 35 H 1 I 35 3 A 2 B 10 C 40 B 1 C 20 0 Sample Output 216 30 题意: 给定村庄数量n,一系列村庄之间的道路每月维护成本信息,让你计算出让所有村

pursuit的博客 583

POJ 1251 + HDU 1301 Jungle Roads 【最小生成树】

这是一道裸的最小生成树题,拿来练手,题目就不放了 个人理解 Prim有些类似最短路和贪心,不断找距当前点最小距离的点 Kruskal类似于并查集,不断找最小的边,如果不是一棵树的节点就合并为一颗树 AC代码: Prim算法: #include<iostream> #include<cstdio> //EOF,NULL #include<cstri...

NoobPlayer_llke的博客 270
上一篇: POJ 1789Truck History——————最小生成树
下一篇: POJ 1611 The Suspects——————并查集
陶鸿杰
博客等级 码龄9年 93粉丝 298原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值