A10030 | Spectator Riots
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
It’s riot time on football stadium Ramacana! Raging fans have entered the field and the police find themselves in a difficult situation. The field can be represented as a square in the coordinate system defined by two diagonal vertices in (0,0) and ( $10^{5}$ , $10^{5}$ ). The sides of that square are also considered to be inside the field, everything else is outside.
In the beginning, there are $N$ fans on the field. For each fan we are given his speed, an integer $v_{i}$ as well as his integer coordinates ( $x_{i}$ , $y_{i}$ ). A fan with those coordinates might move and after one second he might be at any point ( $x_{i}+p$ , $y_{i}+q$ ) where $0<=|p|+|q|<=v_{i}$ . $p$ , $q$ are both integers.
Points that go outside of the square that represents the field are excluded and all others have equal probability of being the location of that specific fan after one second.
Andrej, a young and promising police officer, has sent a flying drone to take a photo of the riot from above. The drone’s camera works like this:
1. It selects three points with integer coordinates such that there is a chance of a fan appearing there after one second. They must not be collinear or the camera won’t work. It is guaranteed that not all of the initial positions of fans will be on the same line.
2. Camera focuses those points and creates a circle that passes through those three points. A photo is taken after one second (one second after the initial state).
3. Everything that is on the circle or inside it at the moment of taking the photo (one second after focusing the points) will be on the photo.
Your goal is to select those three points so that the expected number of fans seen on the photo is maximized. If there are more such selections, select those three points that give the circle with largest radius among them. If there are still more suitable selections, any one of them will be accepted. If your answer follows conditions above and radius of circle you return is smaller then the optimal one by 0.01, your output will be considered as correct.
No test will have optimal radius bigger than $10^{10}$ .
In the beginning, there are $N$ fans on the field. For each fan we are given his speed, an integer $v_{i}$ as well as his integer coordinates ( $x_{i}$ , $y_{i}$ ). A fan with those coordinates might move and after one second he might be at any point ( $x_{i}+p$ , $y_{i}+q$ ) where $0<=|p|+|q|<=v_{i}$ . $p$ , $q$ are both integers.
Points that go outside of the square that represents the field are excluded and all others have equal probability of being the location of that specific fan after one second.
Andrej, a young and promising police officer, has sent a flying drone to take a photo of the riot from above. The drone’s camera works like this:
1. It selects three points with integer coordinates such that there is a chance of a fan appearing there after one second. They must not be collinear or the camera won’t work. It is guaranteed that not all of the initial positions of fans will be on the same line.
2. Camera focuses those points and creates a circle that passes through those three points. A photo is taken after one second (one second after the initial state).
3. Everything that is on the circle or inside it at the moment of taking the photo (one second after focusing the points) will be on the photo.
Your goal is to select those three points so that the expected number of fans seen on the photo is maximized. If there are more such selections, select those three points that give the circle with largest radius among them. If there are still more suitable selections, any one of them will be accepted. If your answer follows conditions above and radius of circle you return is smaller then the optimal one by 0.01, your output will be considered as correct.
No test will have optimal radius bigger than $10^{10}$ .
输入格式
The first line contains the number of fans on the field, $N$ . The next $N$ lines contain three integers: $x_{i}$ , $y_{i}$ , $v_{i}$ . They are the $x$ -coordinate, $y$ -coordinate and speed of fan $i$ at the beginning of the one second interval considered in the task.
- $3<=N<=10^{5}$
- $0<=x_{i},y_{i}<=10^{5}$
- $0<=v_{i}<=1000$
- All numbers are integers
- $3<=N<=10^{5}$
- $0<=x_{i},y_{i}<=10^{5}$
- $0<=v_{i}<=1000$
- All numbers are integers
输出格式
You need to output the three points that camera needs to select. Print them in three lines, with every line containing the $x$ -coordinate, then $y$ -coordinate, separated by a single space. The order of points does not matter.
输入输出样例
输入 #1
3 1 1 1 1 1 1 1 2 1
输出 #1
2 2 2 1 1 0
暂无题解
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted