经典简约
清爽简洁,回归本真
液态水晶
毛玻璃+霓虹光带
赛博朋克
霓虹故障艺术风
🚫
违规操作检测
禁止使用右键菜单
⚠️ 此操作已被系统记录
1

Cranes

📝 题解 🔵 仅限 C++
题目描述
<p>A crane is a wonderful tool for putting up a building. It makes the job go very quickly. When the building must go up even faster, more than one crane can be used. However, when there are too many cranes working on the same building, it can get dangerous. As the cranes spins around, it can bump into another crane if the operator is not careful. Such an accident could cause the cranes to fall over, possibly causing major damage. Therefore, safety regulations require cranes to be spaced far enough apart so that it is impossible for any part of a crane to touch any part of any other crane. Unfortunately, these regulations limit the number of cranes that can be used on the construction site, slowing down the pace of construction. Your task is to place the cranes on the construction site while respecting the safety regulations.</p> <p>The construction site is laid out as a square grid. Several places on the grid have been marked as possible crane locations. The arm of each crane has a certain length <i>r</i>, and can rotate around the location of the crane. The crane covers the entire area that is no more than <i>r</i> units away from the location of the crane. You are to place the cranes to maximize the total area covered by all the cranes.</p>
输入格式
<p>The first line of input contains one integer specifying the number of test cases to follow. Each test case begins with a line containing an integer <i>C</i>, the number of possible locations where a crane could be placed. There will be no more than 15 such locations. Each of the following <i>C</i> lines contains three integers <i>x</i>, <i>y</i>, and <i>r</i>, all between -10 000 and 10 000 inclusive. The first two integers are the grid coordinates of the location, and the third integer is the length of the arm of the crane that can be placed at that location.</p>
输出格式
<p>For each test case, find the maximum area <i>A</i> that can be covered by cranes, and output a line containing a single integer <i>B</i> such that <i>A</i> = <i>B</i> &times; &pi; .</p>
样例
样例输入 1
1 3 0 0 4 5 0 4 -5 0 4
样例输出 1
32
提交代码
请先登录后提交

🤖 AI 解题助手

DeepSeek
就绪
👋 你好!我是 AI 解题助手。
我已阅读了这道题,可以帮你分析思路、提供代码示例。
⚠️ 请先登录后使用