A11264 | Bob and stages
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
The citizens of BubbleLand are celebrating their 10th anniversary so they decided to organize a big music festival. Bob got a task to invite $N$ famous singers who would sing on the fest. He was too busy placing stages for their performances that he totally forgot to write the invitation e-mails on time, and unfortunately he only found $K$ available singers. Now there are more stages than singers, leaving some of the stages empty. Bob would not like if citizens of BubbleLand noticed empty stages and found out that he was irresponsible.
Because of that he decided to choose exactly $K$ stages that form a convex set, make large posters as edges of that convex set and hold festival inside. While those large posters will make it impossible for citizens to see empty stages outside Bob still needs to make sure they don't see any of the empty stages inside that area.
Since lots of people are coming, he would like that the festival area is as large as possible. Help him calculate the maximum area that he could obtain respecting the conditions. If there is no such area, the festival cannot be organized and the answer is 0.00.
Because of that he decided to choose exactly $K$ stages that form a convex set, make large posters as edges of that convex set and hold festival inside. While those large posters will make it impossible for citizens to see empty stages outside Bob still needs to make sure they don't see any of the empty stages inside that area.
Since lots of people are coming, he would like that the festival area is as large as possible. Help him calculate the maximum area that he could obtain respecting the conditions. If there is no such area, the festival cannot be organized and the answer is 0.00.
输入格式
The first line of input contains two integers $N\ (3<=N<=200)$ and $K\ (3<=K<=min(N,50))$ , separated with one empty space, representing number of stages and number of singers, respectively.
Each of the next $N$ lines contains two integers $X_{i}$ and $Y_{i}$ $(0<=X_{i},Y_{i}<=10^{6})$ representing the coordinates of the stages. There are no three or more collinear stages.
Each of the next $N$ lines contains two integers $X_{i}$ and $Y_{i}$ $(0<=X_{i},Y_{i}<=10^{6})$ representing the coordinates of the stages. There are no three or more collinear stages.
输出格式
Output contains only one line with one number, rounded to exactly two decimal places: the maximal festival area. Rounding is performed so that $0.5$ and more rounds up and everything else rounds down.
输入输出样例
输入 #1
5 4 0 0 3 0 2 1 4 4 1 5
输出 #1
10.00
Example explanation: From all possible convex polygon with $4$ vertices and no other vertex inside, the largest is one with points $(0,0)$ , $(2,1)$ , $(4,4)$ and $(1,5)$ .
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted