登录
首页 » C# » 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...

于 2023-03-02 发布 文件大小:211.82 kB
0 41
下载积分: 2 下载次数: 1

代码说明:

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

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • digital
    基于单片机STC89C51和74LS164的多功能数字万用表(Based on microcontroller STC89C51 and 74 ls164 multi-function digital multimeter)
    2013-08-29 22:40:03下载
    积分:1
  • CBCT
    FDK重建算法 希望对其他人能有帮助 用C和cuda 实现的(fdk reconstrcution algorithm using cuda and c source code hope to help others it may be usefull. it is implented by c and cuda)
    2021-01-09 18:38:50下载
    积分:1
  • quartus
    此为quautus教程,请各位仔细去看吧,有不懂的和我联系(This is quautus tutorial, please look at it carefully, and I do not have contact)
    2008-01-31 15:39:00下载
    积分:1
  • 杰奇百度自动推送工具V1.0
    杰奇cms百度自动推送插件下载,杰奇百度自动推送工具V1.0(Jackie CMS Baidu automatic push plug-in download, Jackie Baidu automatic push tool V1.0)
    2020-06-23 10:40:01下载
    积分:1
  • power_wind_dfig
    说明:  风力发电系统matlab仿真模型 风力发电系统matlab仿真模型 风力发电系统matlab仿真模型(Matlab simulation model of wind power generation system)
    2021-04-09 20:08:59下载
    积分:1
  • AD9833-software
    AD9833的编程方法,通过设置一定的参数,可得到DDS(AD9833 programming method, by setting certain parameters, obtained DDS)
    2010-06-04 06:49:06下载
    积分:1
  • PlugY-master
    说明:  source D2 plugin (plugy)
    2020-06-26 13:20:01下载
    积分:1
  • sudoku
    The following is an example of how Microsoft Solver Foundation can be used to solve a constraint satisfaction problem (CSP) like generating a typical Sudoku problem. Sudoku http://www.codeproject.com/Articles/419389/Sudoku-using-Microsoft-solver-foundation In this article I do not attempt to explain everything there is to know about constraint satisfaction problems, but I will go over the concepts in the hope that even if you have never heard of CSP you will still get the idea.
    2012-07-30 16:59:24下载
    积分:1
  • C# 读取像素 颜色 RGB值 实例源码下载
    鼠标移动到哪里 就显示那里的颜色像素值
    2014-09-01下载
    积分:1
  • c# winform QQ表情例子 附完整源码
    winform qq表情功能实现,支持表情管理,支持分页,仅供学习交流使用
    2013-09-22下载
    积分:1
  • 696518资源总数
  • 105578会员总数
  • 20今日下载