CF850A.Five Dimensional Points
普及+/提高
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given set of n points in 5-dimensional space. The points are labeled from 1 to n. No two points coincide.
We will call point a bad if there are different points b and c, not equal to a, from the given set such that angle between vectors
and
is acute (i.e. strictly less than
). Otherwise, the point is called good.
The angle between vectors
and
in 5-dimensional space is defined as
, where
is the scalar product and
is length of
.
Given the list of points, print the indices of the good points in ascending order.
给你一个包含 n 个点的集合,这些点位于五维空间中,编号从 1 到 n。任意两点均不重合。
若存在两个互异且均不等于点 a 的点 b 和 c(均属于给定集合),使得向量 ab 与 ac 的夹角为锐角(即严格小于 2π),则称点 a 为坏点;否则,称其为好点。
在五维空间中,向量 u 与 v 的夹角定义为
arccos(∣u∣∣v∣u⋅v),
其中 u⋅v 表示向量的标量积(点积),∣u∣ 表示向量 u 的长度。
给定这些点的坐标,请按升序输出所有好点的下标(索引)。
输入格式
The first line of input contains a single integer n (1 ≤ n ≤ 103) — the number of points.
The next n lines of input contain five integers a__i, b__i, c__i, d__i, e__i (|a__i|, |b__i|, |c__i|, |d__i|, |e__i| ≤ 103) — the coordinates of the i-th point. All points are distinct.
输入的第一行包含一个整数 n(1 ≤ n ≤ 103)——点的数量。
接下来的 n 行每行包含五个整数 ai,bi,ci,di,ei(∣ai∣,∣bi∣,∣ci∣,∣di∣,∣ei∣ ≤ 103)——第 i 个点的坐标。所有点互不相同。
输出格式
First, print a single integer k — the number of good points.
Then, print k integers, each on their own line — the indices of the good points in ascending order.
首先,输出一个整数 k —— 表示“好点”的个数。
然后,输出 k 个整数,每个整数占一行 —— 按升序排列的“好点”的下标。
输入输出样例
输入#1
6 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1
输出#1
1 1
输入#2
3 0 0 1 2 0 0 0 9 2 0 0 0 5 9 0
输出#2
0
说明/提示
In the first sample, the first point forms exactly a
angle with all other pairs of points, so it is good.
In the second sample, along the cd plane, we can see the points look as follows:

We can see that all angles here are acute, so no points are good.
在第一个样例中,第一个点与其余所有点对形成的角恰好为
,因此它是“好”的。
在第二个样例中,在 cd 平面上,这些点的分布如下所示:

可以看出,此处所有角均为锐角,因此不存在“好”的点。
输入解题思路,AI测评打分。不知道怎么写?