-
Problem description
给定一个赋权无向图G=(V,E),每个顶点v∈V都有一个权值w(v)。如果U包含于V,且对于(u,v)∈E 有u...
Problem description
给定一个赋权无向图G=(V,E),每个顶点v∈V都有一个权值w(v)。如果U包含于V,且对于(u,v)∈E 有u∈U 且v∈V-U,则有v∈K.如:U = {1}, 若有边(1,2), 则有2属于K. 若有集合U包含于V使得U + K = V, 就称U 为图G 的一个顶点覆盖。G 的最小权顶点覆盖是指G 中所含顶点权之和最小的顶点覆盖。
Input
输入数据。第1 行有2 个正整数n 和m,表示给定的图G 有n 个顶点和m条边,顶点编号为1,2,…,n。第2 行有n个正整数表示n个顶点的权。接下来的m行中,每行有2 个正整数u,v,表示图G 的一条边(u,v)。
Output
将计算出的最小权顶点覆盖的顶点权之和输出。
Sample Input
7 7
1 100 1 1 1 100 10
1 6
2 4
2 5
3 6
4 5
4 6
6 7
Sample Output
13
-Problem description
给定一个赋权无向图G=(V,E),每个顶点v∈V都有一个权值w(v)。如果U包含于V,且对于(u,v)∈E 有u∈U 且v∈V-U,则有v∈K.如:U = {1}, 若有边(1,2), 则有2属于K. 若有集合U包含于V使得U+ K = V, 就称U 为图G 的一个顶点覆盖。G 的最小权顶点覆盖是指G 中所含顶点权之和最小的顶点覆盖。
Input
输入数据。第1 行有2 个正整数n 和m,表示给定的图G 有n 个顶点和m条边,顶点编号为1,2,…,n。第2 行有n个正整数表示n个顶点的权。接下来的m行中,每行有2 个正整数u,v,表示图G 的一条边(u,v)。
Output
将计算出的最小权顶点覆盖的顶点权之和输出。
Sample Input
7 7
1 100 1 1 1 100 10
1 6
2 4
2 5
3 6
4 5
4 6
6 7
Sample Output
13
- 2023-03-02 06:00:03下载
- 积分:1
-
Yang Xiaoguang s C# courseware, ppt, the novice can have a look
杨晓光的C#课件,ppt的,新手可以-Yang Xiaoguang s C# courseware, ppt, the novice can have a look
- 2022-02-01 07:32:47下载
- 积分:1
-
cifafengxi
程序中先判断这个句语句中每个单元为关键字、常数、运算符、界符,对与不同的单词符号给出不同编码形式的编码,用以区分之。(proceedings of the first judgment of sentence statement, the keyword for each of the modules, constant, Operators, the industry website. pairs with different words are given different symbols coding forms of coding to differentiate.)
- 2007-04-29 19:09:28下载
- 积分:1
-
stm32
德飞莱STM32系列尼莫M3S V1.0开发板资料4-配套程序出厂附带-ucGUI 测试程序( De Feilai STM32 series Nemo M3S V1.0 development board data 4- Companion Programs test program shipped with-ucGUI)
- 2020-12-29 22:59:01下载
- 积分:1
-
C + + 刽子手游戏项目
在Hangman游戏,电脑随机选择一个词从一个
- 2022-02-03 07:03:37下载
- 积分:1
-
qt-3dconstruct
qt vtk医学图像二维显示,医学图像三维重建,可滚动条设置切片索引(qt vtk-dimensional medical image display, 3D medical image reconstruction, scroll bar to set slice indices)
- 2013-07-17 20:17:48下载
- 积分:1
-
pm2.5lcd
校内竞赛做了一个PM2.5测量仪,采用pm2.5传感器DSM501A测得PM2.5的浓度并把它转化为脉冲量,通过51单片机检测脉冲量并把它转化为数字量,经过换算,送到LCD1602进行显示。
(School race made a PM2.5 measuring instrument, using pm2.5 sensor DSM501A measured concentrations of PM2.5 and put it into pulses, pulses detected by the microcontroller 51 and convert it to digital, after conversion, send to LCD1602 display.)
- 2021-04-22 22:38:48下载
- 积分:1
-
CSharp-WebService
C#
- 2011-04-17 14:12:51下载
- 积分:1
-
CUDAmanualforChinese
cuda中文手册,对cuda的完整描述,是cuda爱好者与开发者的必备资料(This is a cuda manual in Chinese.The book describeds all details about cuda,which is a essential one for cuda
lovers. )
- 2020-12-31 10:58:59下载
- 积分:1
-
fruit-recognition-master
运用了OpenCV、C++、水果识别、Qt界面、颜色识别、边缘检测、图像处理 ,能够实现对不同种类水果进行识别分类。(Using OpenCV, C++, fruit recognition, Qt interface, color recognition, edge detection, and image processing, it is possible to identify and classify different types of fruits.)
- 2021-04-16 10:58:53下载
- 积分:1