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

  • STM32_KS103_IIC
    说明:  0.我使用的是F103VET6,但软件IIC原理都是一样的,改引脚配置后可方便移植 1.连接引脚前,可以只连接VCC和GND查看模块当前地址:模块上的LED指示灯会渐亮,然后就是快闪(1)和慢闪(0),将值记录下来,用计算器转换一下就是当前的地址值了(0. I use F103VET6, but the principle of software IIC is the same, pin configuration can be easily transplanted. 1. Before connecting pins, you can only connect VCC and GND to view the current address of the module: the LED light on the module will gradually light up, then flash (1) and slow flash (0), record the value, and convert it with a calculator to the current address value.)
    2020-06-19 11:20:02下载
    积分:1
  • opencv边缘检测简单例子
    opencv边缘检测简单例子,采用sobel算子、canny算子、laplace算子。 注:需要先设置opencv的路径,已经测试通过。
    2022-04-15 01:39:03下载
    积分:1
  • C# 绘制实时曲线包括绘制坐标轴
    绘制实时曲线,可以为测控设备上位机软件提供解决方案。plc运功控制卡实时曲线显示、饼状图,柱状图等(Drawing real-time curves can provide solutions for PC software of measurement and control equipment. Real-time curve display, pie chart, column chart of PLC power control card)
    2020-07-09 07:48:55下载
    积分:1
  • duobleloop
    求解双环网络直径的源程序,用Csharp语言编写(for Shuanghuan network diameter of the source, using language Csharp)
    2007-05-22 00:09:48下载
    积分:1
  • 边缘提取算子,canny、sobel、log算子
    边缘提取算子,canny、sobel、log算子,利用vs2013编写的数字图像处理中常见的几种边缘提取算子。
    2022-03-04 17:35:36下载
    积分:1
  • UA-Nodeset
    This repository contains UANodeSets and other normative files which are released with a specification. Any change to a specification (release of a new version or errata) may require a change to the files in this repository.
    2020-06-21 03:00:01下载
    积分:1
  • KMDF_hypervisor
    说明:  一个x64 vt hypervisor内部实现ept技术简易框架 ,在此框架下根据需求可以改造使用ept技术进行内存隐藏。。。(An x64x64 vt hypervisor with ept etc.)
    2020-06-17 22:20:01下载
    积分:1
  • 油田搜索
    说明:  基于油田实例为二维的搜索算法(深度优先搜索)(Search algorithm (DFS) based on 2D Oilfield)
    2021-01-17 19:27:29下载
    积分:1
  • STM32-IIC
    自己根据3.5库改进的STM32硬件IIC,使用DMA,解决网上其他例程弊病,内含完整工程,运行通过。(IIC STM32 hardware itself according to the 3.5 library improvements, using DMA, other routines to solve the Internet s ills, including complete engineering, running through.)
    2020-11-18 17:29:38下载
    积分:1
  • IPHONE4
    Simple app that communicates with the iPhone/iPod/iPad serial port for debugging/hobbyst purpose.
    2014-03-14 09:15:49下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载