A8157 | Contact
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Little Petya is preparing for the first contact with aliens. He knows that alien spaceships have shapes of non-degenerate triangles and there will be exactly 4 ships. Landing platform for a ship can be made of 3 special columns located at some points of a Cartesian plane such that these 3 points form a triangle equal to the ship with respect to rotations, translations (parallel shifts along some vector) and reflections (symmetries along the edges). The ships can overlap after the landing.
Each column can be used to land more than one ship, for example, if there are two equal ships, we don't need to build 6 columns to land both ships, 3 will be enough. Petya wants to know what minimum number of columns will be enough to land all ships.
Each column can be used to land more than one ship, for example, if there are two equal ships, we don't need to build 6 columns to land both ships, 3 will be enough. Petya wants to know what minimum number of columns will be enough to land all ships.
输入格式
Each of 4 lines will contain 6 integers $x_{1}$ $y_{1}$ $x_{2}$ $y_{2}$ $x_{3}$ $y_{3}$ ( $0<=x_{1},y_{1},x_{2},y_{2},x_{3},y_{3}<=20$ ), representing 3 points that describe the shape of each of 4 ships. It is guaranteed that 3 points in each line will represent a non-degenerate triangle.
输出格式
First line should contain minimum number of columns enough to land all spaceships.
输入输出样例
输入 #1
0 0 1 0 1 2 0 0 0 2 2 2 0 0 3 0 1 2 0 0 3 0 2 2
输出 #1
4
输入 #2
0 0 0 1 1 1 0 0 0 2 2 2 0 0 0 5 5 5 0 0 0 17 17 17
输出 #2
9
In the first test case columns can be put in these points: $(0,0),(1,0),(3,0),(1,2)$ . Note that the second ship can land using last 3 columns.
In the second test case following points can be chosen: $(0,0),(0,1),(1,0),(0,2),(2,0),(0,5),(5,0),(0,17),(17,0)$ . It is impossible to use less than 9 columns.
In the second test case following points can be chosen: $(0,0),(0,1),(1,0),(0,2),(2,0),(0,5),(5,0),(0,17),(17,0)$ . It is impossible to use less than 9 columns.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted