给出n个5维下的点,求点a不与其它任意的b,c重合,向量ab,ac的夹角都为钝角,这样的点个数,并打印它们。
转换二维下的求角度的函数为五维的,而且由于要求角度大于90度,在二维情况下最多有4个点,也就是象限的数量,那么推导到5维就有$2^5$个象限,所以实际上只需要判断这么多个点就能退出了,并不会TLE
/** @Date : 2017-09-04 23:12:31* @FileName: C.cpp* @Platform: Windows* @Author : Lweleth (SoungEarlf@gmail.com)* @Link : https://github.com/* @Version : $Id$*/
#include <bits/stdc++.h>
#define LL long long
#define PII pair<int ,int>
#define MP(x, y) make_pair((x),(y))
#define fi first
#define se second
#define PB(x) push_back((x))
#define MMG(x) memset((x), -1,sizeof(x))
#define MMF(x) memset((x),0,sizeof(x))
#define MMI(x) memset((x), INF, sizeof(x))
using namespace std;const int INF = 0x3f3f3f3f;
const int N = 1e5+20;
const double eps = 1e-8;
const double Pi = acos(-1.0);
//减少精度问题
int sign(double x)
{if(fabs(x) < eps)return 0;if(x < 0)return x;else return x;
}struct yuu
{double a, b, c, d, e;yuu(){}yuu(double aa, double bb, double cc, double dd, double ee):a(aa),b(bb),c(cc),d(dd),e(ee){}yuu operator -(const yuu &y) const {//cout << y.a << y.b << y.c << y.d << y.e<<endl;return yuu(sign(y.a-a) , sign(y.b-b) , sign(y.c-c) , sign(y.d-d) , sign(y.e-e));}double operator *(const yuu &y){double ans = (a*y.a) + (b*y.b) + (c*y.c)+ (d*y.d) + (e*y.e);//cout << ans << endl;return sign(ans);}
};double leng(yuu x, yuu y)
{if(sign(x*y) == 0)return -1;double ans = sqrt(sign(x*y));return ans;
}yuu p[1010];
int main()
{int n;while(cin >> n){for(int i = 0; i < n; i++){double a, b, c, d, e;//double 写错intscanf("%lf%lf%lf%lf%lf",&a, &b, &c, &d, &e);p[i] = yuu(a, b, c, d, e);//cout << p[i].a << endl;}vector<int>q;for(int i = 0; i < n; i++){int flag = 0;for(int j = 0; j < n && !flag; j++){for(int k = j + 1; k < n; k++){if(i == j || j == k || i == k)continue;yuu ij = p[i] - p[j];yuu ik = p[i] - p[k];/*if(leng(ij,ij) == -1 || leng(ik,ik) == -1)continue;*/double agl = acos(ij * ik / (leng(ij, ij) * leng(ik, ik)));/*if(i == 1 && j == 2 && k == 3)printf("%.lf %.lf\n", leng(ij, ij) , leng(ik, ik));*///cout << i << j<< k<< "~"<<agl * 180.00 / Pi<< endl;if(agl * 2.00000 + eps < Pi){flag = 1;break;}}}if(!flag)q.PB(i);}sort(q.begin(), q.end());printf("%d\n", q.size());for(int i = 0; i < q.size(); i++)printf("%d%s", q[i] + 1, i==q.size() - 1?"\n":" ");}return 0;
}