Everyone is afraid of something. Someone is afraid of darkness, someone is afraid of heights,
someone is afraid of Vinnie Jones (all of us are afraid of Vinnie Jones), someone is afraid of singing
before eating something…
There are many fears, but the greatest among all for Mirko is choosing a land for planting
strawberries. Mirko’s land can be described as a matrix with N rows and M columns. Some of the
fields in the matrix are suitable for planting strawberries and some are not – weeds grow there. Mirko
is looking for rectangular parts of the land that are completely filled with fields suitable for strawberry
planting. Those kind of rectangles are called suitable rectangles. Also, Mirko is interested in the
potential value of all fields in the matrix. The potential value of each field in the matrix is defined as
the number of suitable rectangles that contain that field.
Since Mirko has troubles facing his
COCI 2018/2019 Strah(极大子矩形思想)
最新推荐文章于 2024-06-26 13:13:53 发布
这篇博客讲述了Mirko面临的最大恐惧——选择种植草莓的土地。土地由N行M列组成,部分区域适合种植,部分区域长满杂草。他关注的是完全适合种植的矩形区域(称为合适矩形)以及每个位置的潜在价值,即包含该位置的合适矩形数量。文章通过将问题转化为求所有合法矩形的面积总和,并采用单调队列枚举极大子矩形的方法来求解,但未详细说明极大子矩形的算法实现,只提供了AC代码。
摘要由CSDN通过智能技术生成