当前位置:网站首页>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代码:
边栏推荐
- Detail throw and throws
- Necessary foundation: Signature Verification
- QT | qcheckbox of control
- Cvpr22 | graph neural architecture search of relational consciousness
- 堆
- What should I do if I can't see any tiles on SAP Fiori launchpad?
- 开关量输入输出模块DAM-5055
- 分布式系统架构理论与组件
- Nodejs body parser middleware processes post form data of type multipart / form data, and req.body cannot receive data
- Overview of famous inner classes and anonymous inner classes
猜你喜欢

JS true / false array conversion

Why does MySQL index use b+ tree instead of jump table?

Dominoes staged: the beginning and end of the three arrow capital crash

Use redis' sorted set to make weekly hot reviews

What are metauniverse and NFT digital collections?

Good looking (dynamic) Jay fan self-made dynamic album card (front and back are different) and lyrics page

"Game engine light in light out" 4.1 unity shader and OpenGL shader

XXL job parameter transfer

Summary of common methods of ArrayList

(10) STM32 - systick tick timer
随机推荐
Keil mdk5.37 and above can add AC5 (armcc) compiler by themselves
Redis distributed online installation
Dominoes staged: the beginning and end of the three arrow capital crash
开关量输入输出模块DAM-5055
Openpyxl drawing area map
Unity 2D game tutorial
XXL job parameter transfer
Four characteristics of transactions (acid):
Data Lake (20): Flink is compatible with iceberg, which is currently insufficient, and iceberg is compared with Hudi
Detail the execution process of JDBC query method
2021-3-22-tencent - minimum number of guards
虚拟偶像的歌声原来是这样生成的!
Error: slf4j: class path contains multiple slf4j bindings
【萌新解题】斐波那契数列
Xianghe meat cake in memory
Cvpr22 | graph neural architecture search of relational consciousness
Overview of static inner classes and non static inner classes
GAN:生成对抗网络 Generative Adversarial Networks
4. Analysis of the execution process of make modules for general purposes
Vi. analysis of makefile.build