当前位置:网站首页>Poj2446 chessboard [maximum matching of bipartite graph]
Poj2446 chessboard [maximum matching of bipartite graph]
2022-07-27 13:04:00 【51CTO】
Topic link :
http://poj.org/problem?id=2446
The main idea of the topic :
Give me a N*M Matrix , Among them is K There is a pit in one place . I'll tell you this K The location of the pit , Now use 1*2 Rectangular plate to cover
matrix , Do not cover places with pits . ask : Can you cover all the places except the pit , If you can , The output "YES",
Otherwise output "NO".
Ideas :
Considering that the specification of rectangular plate is 1*2, Then the adjacent position (i,j) and (x,y) It must be (i+j) For an odd number ,(x+y) It's an even number .
(i+j) Even numbers ,(x+j) Then it is an odd number . such , You can divide all the points on the graph into horizontal and vertical coordinates and add them to the sum of odd points
The horizontal and vertical coordinates are added to an even number of points . Then build a bipartite graph , One side is odd , The other side is an even number of points . If you can use moments
The shape plate covers ( That is, there is no pit ), Then add edges to the bipartite graph . Then find the maximum match of bipartite graph ans, That is, the maximum coverage
Rectangular plate . Because the specification of each rectangular plate is 1*2, So we should judge whether we can cover all the places except the pit , just
To judge ans*2 + K Is it equal to M*N that will do .
AC Code :
边栏推荐
- Do you really understand CMS garbage collector?
- 详述反射中构造方法、属性和普通方法
- SQL statement problem, calculate the data with a difference of less than 10 minutes to be displayed as the same batch of data
- flinksql从Oracle同步数据到Doris,一共50几个字段,Oracle表中3000多万条
- Unity 2D game tutorial
- Cvpr22 | graph neural architecture search of relational consciousness
- Delay queue performance test
- HDU1698_ Just a Hook
- Four characteristics of transactions (acid):
- Why does the class annotated with @configuration generate cglib proxy?
猜你喜欢

详述HashSet的add方法

How to use the server to build our blog

Cvpr22 | graph neural architecture search of relational consciousness

ArrayList常用方法总结

HDU1698_Just a Hook

Summary of common methods of ArrayList

Overview of static inner classes and non static inner classes

What are metauniverse and NFT digital collections?

Top 10 international NFT exchanges

Security measures for tcp/ip protocol vulnerabilities
随机推荐
Detail the construction methods, attributes and common methods in reflection
爬虫
Mixin\ plug in \scoped style
"Game engine light in light out" 4.1 unity shader and OpenGL shader
Photoshop web design tutorial
PySide6/PyQt开发经验总结(2) - 设置快捷键
Basic architecture of data Lake
【萌新解题】斐波那契数列
Poj2594 treasure exploration [bipartite graph minimum path coverage] [Floyd]
概述有名内部类与匿名内部类
sql 语句问题, 求计算相差10分钟以内的数据作为同一批次数据显示
592. 分数加减运算 : 表达式计算入门题
文章复现:SRCNN
Complete data summary of lapsus$apt organization that stole Microsoft's source code in March 2022
P1321 word overlay restore [getting started]
正则表达式去除两端空格
「游戏引擎 浅入浅出」4.1 Unity Shader和OpenGL Shader
500强企业如何提升研发效能?来看看行业专家怎么说!
CEPH distributed storage performance tuning (6)
程序员培训学习后好找工作吗