CF18A.Triangle
普及/提高-
通过率:0%
时间限制:2.00s
内存限制:64MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
At a geometry lesson Bob learnt that a triangle is called right-angled if it is nondegenerate and one of its angles is right. Bob decided to draw such a triangle immediately: on a sheet of paper he drew three points with integer coordinates, and joined them with segments of straight lines, then he showed the triangle to Peter. Peter said that Bob's triangle is not right-angled, but is almost right-angled: the triangle itself is not right-angled, but it is possible to move one of the points exactly by distance 1 so, that all the coordinates remain integer, and the triangle become right-angled. Bob asks you to help him and find out if Peter tricks him. By the given coordinates of the triangle you should find out if it is right-angled, almost right-angled, or neither of these.
在几何课上,鲍勃学到:若一个三角形是非退化的,且其一个内角为直角,则该三角形称为直角三角形。鲍勃决定立刻画出这样一个三角形:他在一张纸上画出了三个具有整数坐标的点,并用直线段将它们两两连接,然后将这个三角形展示给彼得。彼得说鲍勃画的三角形不是直角三角形,但却是近似直角三角形:该三角形本身并非直角三角形,但可以恰好将其中一个点移动距离 1(即移动后该点与原位置的欧氏距离为 1),使得所有点的坐标仍为整数,且移动后的三角形成为直角三角形。鲍勃请你帮他判断彼得是否在欺骗他。根据所给三角形三个顶点的坐标,请你判断该三角形是直角三角形、近似直角三角形,还是两者都不是。
输入格式
The first input line contains 6 space-separated integers _x_1, _y_1, _x_2, _y_2, _x_3, _y_3 — coordinates of the triangle's vertices. All the coordinates are integer and don't exceed 100 in absolute value. It's guaranteed that the triangle is nondegenerate, i.e. its total area is not zero.
第一行输入包含 6 个用空格分隔的整数 x1, y1, x2, y2, x3, y3 —— 表示三角形三个顶点的坐标。所有坐标的绝对值均不超过 100。题目保证该三角形是非退化的,即其总面积不为零。
输出格式
If the given triangle is right-angled, output RIGHT, if it is almost right-angled, output ALMOST, and if it is neither of these, output NEITHER.
如果给定的三角形是直角三角形,则输出 RIGHT;如果是近似直角三角形,则输出 ALMOST;如果两者都不是,则输出 NEITHER。
输入输出样例
输入#1
0 0 2 0 0 1
输出#1
RIGHT
输入#2
2 3 4 5 6 6
输出#2
NEITHER
输入#3
-1 0 2 0 0 1
输出#3
ALMOST
输入解题思路,AI测评打分。不知道怎么写?