当前位置:网站首页>POJ1548 Robots【二分图最小路径覆盖】
POJ1548 Robots【二分图最小路径覆盖】
2022-07-27 12:35:00 【51CTO】
题目链接:
http://poj.org/problem?id=1548
题目大意:
在一个N*M(N <= 24,M <= 24)的图中,有很多垃圾, 清理垃圾的机器人从左上角开始清理。已
知机器人只能向右或是向下清理垃圾,在清理完一个地方的垃圾后可以继续向右或是向下去清理
其他垃圾。最终运行到(N,M)的位置终止。问:最少需要多少个机器人,能清理完所有的垃圾。
思路:
图中没有给N和M的大小,只是给出了垃圾的位置。输入用0 0表示一组数据输入结束。建一个结构
体来存储垃圾的坐标值。现在来建一个二分图,图的两边就是垃圾的节点,遍历原图,如果垃圾j在
垃圾i的右下角,就将(i,j)加入到二分图中,最后问题就变为了:求该二分图的最小路径覆盖。由二
分图最小路径覆盖 = 点数 - 二分图最大匹配,根据匈牙利算法求出二分图最大匹配,然后得出结果。
AC代码:
边栏推荐
- POJ1988_Cube Stacking
- Top of the tide - reading notes + excerpts + insights
- Why do you need foreign keys?
- J9 number theory: how long is the mainstreaming of decentralized identity?
- 关于 CMS 垃圾回收器,你真的懂了吗?
- Xianghe meat cake in memory
- 开关量输入输出模块DAM-5055
- 隔离级别
- An overview of kernel compilation system
- 详述反射中构造方法、属性和普通方法
猜你喜欢

Will MySQL fail to insert data? Why?

Laboratory procedures and references of chloramphenicol acetate

MySQL扩展

Use redis' sorted set to make weekly hot reviews

概述有名内部类与匿名内部类

JS true / false array conversion

II. Analysis of the execution process of make menuconfig

HDU1698_Just a Hook

20210512 recursive formula

Play CSDN editor
随机推荐
Laboratory procedures and references of chloramphenicol acetate
Map interface
Will MySQL fail to insert data? Why?
Julia beginner tutorial 2022
About typora's inability to log in after March 9, 2022 -- resolved
SQL question brushing: find out the current salary of all employees
内涵语录
Why does MySQL index use b+ tree instead of jump table?
Redis distributed online installation
POJ1273 Drainage Ditches【最大流】【SAP】
Summary of common methods of ArrayList
POJ1611_ The Suspects
"Game engine light in light out" 4.1 unity shader and OpenGL shader
Xianghe meat cake in memory
Map接口
Configuration files in MySQL
js日期时间格式化(年月日、时分秒、星期、季度、获取时间差、日期与时间戳转换的功能)
分布式系统架构理论与组件
5V boost 9V chip
Wechat applet session holding