简要题意:给出
n
个
先考虑在二维平面下满足要求的点,以这个点为原点做平面直角坐标系,则该平面除原点外至多只会包含
4
个点,这四个点分别处于不同象限。否则,答案为
对于
k
维平面,除原点外这样的点至多包含
因此当点数多于11个,答案必然不存在。否则我们暴力即可。(直接暴力也能过就是了= =!)
#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
typedef long long LL;
int n;
struct Point {
int a, b, c, d, e;
void in() {
scanf("%d%d%d%d%d", &a, &b, &c, &d, &e);
}
Point operator - (const Point & rhs) const {
return {a-rhs.a, b-rhs.b, c-rhs.c, d-rhs.d, e-rhs.e};
}
double operator * (const Point & rhs) const {
return a*rhs.a + b*rhs.b + c*rhs.c + d*rhs.d + e*rhs.e;
}
} point[12];
double len(Point a) {
return sqrt(a*a);
}
int main() {
scanf("%d", &n);
if(n > 11) return 0 * puts("0");
else {
vector<int> res;
for(int i = 0; i < n; i++) point[i].in();
for(int i = 0; i < n; i++) {
bool sign = 1;
for(int j = 0; j < n; j++) {
for(int k = 0; k < n; k++) {
if(i != j && j != k && i != k) {
Point x = point[j]-point[i];
Point y = point[k]-point[i];
if(acos(x * y / len(x) / len(y)) < acos(-1.0)/2)
sign = 0;
}
}
}
if(sign) res.push_back(i+1);
}
cout<<res.size()<<endl;
for(int i = 0; i < res.size(); i++)
cout<<res[i]<<" ";
}
return 0;
}