CF68E.Contact
省选/NOI-
通过率:0%
时间限制:3.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
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.
小佩佳正在为首次与外星人接触做准备。他知道外星飞船的形状均为非退化三角形,且总共将有恰好 4 艘飞船。一艘飞船的着陆平台可由位于笛卡尔平面上某三点处的 3 根特殊立柱构成,要求这三点所构成的三角形与该飞船全等(即允许通过旋转、平移(沿某一向量的平行移动)和反射(关于某条边的对称)变换相互重合)。飞船着陆后可以相互重叠。
每根立柱可用于多艘飞船的着陆;例如,若存在两艘全等的飞船,则无需建造 6 根立柱来分别着陆这两艘飞船,仅需 3 根即可。佩佳想知道:着陆全部 4 艘飞船所需的最少立柱数量是多少?
输入格式
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.
每行包含 4 行,每行含 6 个整数 x1 y1 x2 y2 x3 y3(0 ≤ x1,y1,x2,y2,x3,y3 ≤ 20),表示描述 4 艘船各自形状的 3 个点。保证每行中的 3 个点构成一个非退化三角形。
输出格式
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.
在第一个测试用例中,柱子可以放置在以下坐标处:(0,0),(1,0),(3,0),(1,2)。注意,第二艘飞船可以借助最后三根柱子着陆。
在第二个测试用例中,可选择以下坐标:(0,0),(0,1),(1,0),(0,2),(2,0),(0,5),(5,0),(0,17),(17,0)。使用少于 9 根柱子是不可能的。
输入解题思路,AI测评打分。不知道怎么写?