登录
首页 » 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 57
下载积分: 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 个回复

  • FRAME6.03
    说明:  MFC六大关键技术之仿真:(永久保存机制)实例(MFC six key technology simulation: (permanent preservation mechanism) instance)
    2010-04-08 01:40:16下载
    积分:1
  • 能够根据Data控件、MSRDC控件、DAO、RDO中的结果数据自动生成二维数据,并打印输出的控件...
    能够根据Data控件、MSRDC控件、DAO、RDO中的结果数据自动生成二维数据,并打印输出的控件-according to Data Control, MSRDC controls, DAO, RDO of outcome data automatically generate two-dimensional data, and print output control
    2023-05-28 11:50:02下载
    积分:1
  • bms.zip
    电动汽车开发资料,电池管理资料和源代码,只要是电池均衡技术和管理技术,有能量管理技术(bms,look look deds edgde desfse sddfe ifyheiyoeud doed dlekd lskske dkeks ksksk kskskkdjend ksksj ksjh ndnd mdnfn ndkfndmdkfjd dkdkf ddkdjfdn kdnvndk dkdndnd dkdkddndndl)
    2012-08-02 11:08:05下载
    积分:1
  • V4L2
    简单的V4L2入门知识总结,V4L2官方说明文档已经视频应用开发手册(Summary of simple V4L2 introductory knowledge)
    2020-07-08 15:18:56下载
    积分:1
  • company_network
    搭建一个有4个部门的公司网络,包含研发部门、测试部门、管理部门和销售部门,利用局域网模型在一个对象中模拟一个服务器和多个客户端的行为(Set up a department of four corporate network, including R & D department, testing department, management department and sales department, the use of local area network model of an object in the simulation at a server and multiple clients of conduct)
    2009-04-08 19:35:59下载
    积分:1
  • matlab-voice-analysic
    说明:  matlab实现的语音分析,其中,有lpc分析。程序都经过软件验证,没有错误。(matlab implementation of speech analysis, of which there lpc analysis. Software programs have been validated without error.)
    2011-02-22 22:47:27下载
    积分:1
  • jumping_the_queue
    The beginning of a winter break near Spring Festival is always the beginning of a peak period of transportation. If you have ever tried to get a train ticket at that time, you must have witnessed the endless queues in front of every ticket box window. If a guy has seen his friend in a queue, then it is very much likely that this lucky guy might go straight to his friend and ask for a favor. This is called "jumping the queue". It is unfair to the rest of the people in the line, but, it is life. Your task is to write a program that simulates such a queue with people jumping in every now and then, assume that, if one in the queue has several friends asking for favors, he would arrange their requests in a queue of his own(The beginning of a winter break near Spring Festival is always the beginning of a peak perio d of transportation. If you have ever tried to ge not a train ticket at that time. you must have witnessed the endless queues in fr ont of every ticket box window. If a guy has seen h is friend in a queue, then it is very much likely that this lucky guy mi ght go straight to his friend and ask for a favor. This is called "jumping the queue." It is unfair to the rest of the people in the line, but, it is life. Your task is to write a program that si mulates such a queue with people jumping in ever y now and then, assume that, if one in the queue has several friends asking az r favors. he would arrange their requests in a queue of his own)
    2006-11-04 20:29:57下载
    积分:1
  • Curve_fitting
    对平面上给定的多点进行多项式曲线的拟合,可设置拟合多项式的次数(Given more points on the plane polynomial curve fitting, you can set the number of polynomial fitting)
    2021-02-14 15:29:49下载
    积分:1
  • ATT7022CCheckAccuracy
    基于ATT7022C的三相电能表电量采集系统的纯软件自动校表的后台软件!(The three-phase watt-hour meter based on ATT7022C power acquisition system of pure software automatically table of backend software school )
    2011-08-05 14:00:46下载
    积分:1
  • Circ_List
    数据结构实验 循环链表的实现 测试函数main(Data structure experiment The implementation test function main of the loop list)
    2018-01-09 11:12:40下载
    积分:1
  • 696518资源总数
  • 106208会员总数
  • 21今日下载