当前位置:网站首页>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 :
边栏推荐
- Top 10 international NFT exchanges
- Do you really understand CMS garbage collector?
- Summary of common methods of ArrayList
- Insert sort summary
- Error: slf4j: class path contains multiple slf4j bindings
- P1321 word overlay restore [getting started]
- 爬虫
- 多表查询
- How to use the server to build our blog
- Baoli food listed on Shanghai Stock Exchange: annual revenue of 1.578 billion, market value of 5.8 billion
猜你喜欢

C program debugging and exception handling (try catch)

The sparksubmit. Main () method submits external parameters and remotely submits the standalone cluster task

CEPH distributed storage performance tuning (6)

Will causal learning open the next generation of AI? Chapter 9 Yunji datacanvas officially released the open source project of ylarn causal learning

CVPR22 | 关系意识的图神经架构搜索

ECCV2022 | RU&谷歌提出用CLIP进行zero-shot目标检测!

heap

Error: the source of the existing CacheManager is: urlconfigurationsource

Complete data summary of lapsus$apt organization that stole Microsoft's source code in March 2022

Specify the add method of HashSet
随机推荐
POJ1273 Drainage Ditches【最大流】【SAP】
JS single thread understanding notes - Original
SSM practical project - front back separation (easy to understand)
BSP视频教程第21期:轻松一键实现串口DMA不定长收发,支持裸机和RTOS,含MDK和IAR两种玩法,比STM32CubeMX还方便(2022-07-24)
详述HashSet的add方法
heap
JS date and time format (year, month, day, hour, minute, second, week, quarter, time difference acquisition, date and timestamp conversion function)
Isolation level
Lambda expression
Why does MySQL index use b+ tree instead of jump table?
Dominoes staged: the beginning and end of the three arrow capital crash
C program debugging and exception handling (try catch)
SQL question brushing: find out the current salary of all employees
redis分布式在线安装
About typora's inability to log in after March 9, 2022 -- resolved
MySQL extensions
[database data recovery] a data recovery case in which the disk partition where the SQL Server database is located is insufficient and an error is reported
HDU1698_ Just a Hook
Four characteristics of transactions (acid):
What should I do if I can't see any tiles on SAP Fiori launchpad?