UVa 1312 Cricket Field 解题报告(枚举 + 离散化)

该博客介绍了如何解决UVa 1312 Cricket Field的问题,即在不破坏树木的情况下找到公园内最大的正方形板球场。博主提出通过离散化树的y坐标并枚举板球场的边界来找到最大尺寸,并提供了解题思路和复杂度分析,以及代码实现。
摘要由CSDN通过智能技术生成

1312 - Cricket Field

Time limit: 3.000 seconds
\epsfbox{p2689.eps}

Once upon a time there was a greedy King who ordered his chief Architect tobuild a field for royal cricket inside his park. The King was so greedy, that hewould not listen to his Architect's proposals to build a field right in thepark center with pleasant patterns of trees specially planted around and beautiful walksinside tree alleys for spectators. Instead, he ordered neither to cut nor to planteven a single tree in his park, but demanded to build the largest possible cricketfield for his pleasure. If the Kind finds that the Architect has dared to touch evena single tree in his park or designed a smaller field that it was possible, thenthe Architect will loose his head. Moreover, he demanded his Architect to introduceat once a plan of the field with its exact location and size.

Your task is to help poor Architect to save his head, by writing a program thatwill find the maximum possible size of the cricket field and its location insidethe park to satisfy King's requirements.

The task is somewhat simplified by the fact, that King's park has a rectangular shapeand is situated on a flat ground. Moreover, park's borders are perfectly aligned withNorth-South and East-West lines. At the same time, royal cricket is always played on asquare field that is also aligned with North-South and East-West lines. Architect hasalready established a Cartesian coordinate system and has precisely measured thecoordinates of every tree. This coordinate system is, of course, aligned withNorth-Sout

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值