【链接】点击打开链接


【题意】


给你n个5维的点。
然后让你以其中的某一个点作为起点a。
另选两个点b,c.
组成向量a->b,a->c
如果所有的a->b和a->c的夹角都是钝角或直角。则称a这个点good.
否则bad.
让你输出所有为good的点。

【题解】


考虑二维空间里面的一个点a.
那么假设另外还有5个点的话。
是没有办法所有组成的角都是钝(直)角的。
因为只有两个不同象限(或在坐标轴上)的点,和它组成角,才可能组成≥90°的角。
(这里象限是说,以这个点a为原点,画一个坐标系)
也就是如果一个点为good的话,其他的点的个数绝对不能超过4个。(4个象限嘛。。)
那么也就是说,如果n大于一定的范围,是肯定无解的(这里是5维空间,就不是刚才说的4了).
具体的。
你就选一个n^3不会超时的n,然后大于这个数字,就直接输出无解就好。
小于n的话,就暴力做。

【错的次数】


0

【反思】


除非全是xx否则不是good的。
因为中间只要有一个不满足就可以直接break.
可能都有优化方法?
看起来没办法优化时间。
就要从n考虑了。
是不是它能缩小?
是不是它是没有用的?

【代码】

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <cstdlib>
#include <cmath>
#include <bitset>
using namespace std;
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define LL long long
#define rep1(i,a,b) for (int i = a;i <= b;i++)
#define rep2(i,a,b) for (int i = a;i >= b;i--)
#define mp make_pair
#define pb emplace_back
#define fi first
#define se second
#define ld long double
#define ms(x,y) memset(x,y,sizeof x)
#define ri(x) scanf("%d",&x)
#define rl(x) scanf("%lld",&x)
#define rs(x) scanf("%s",x)
#define rf(x) scnaf("%lf",&x)
#define oi(x) printf("%d",x)
#define ol(x) printf("%lld",x)
#define oc putchar(' ')
#define os(x) printf(x)
#define all(x) x.begin(),x.end()
#define Open() freopen("F:\\rush.txt","r",stdin)
#define Close() ios::sync_with_stdio(0)
#define sz(x) ((int) x.size())
#define ld long double typedef pair<int,int> pii;
typedef pair<LL,LL> pll; //mt19937 myrand(time(0));
//int get_rand(int n){return myrand()%n + 1;}
const int dx[9] = {0,1,-1,0,0,-1,-1,1,1};
const int dy[9] = {0,0,0,-1,1,-1,1,-1,1};
const double pi = acos(-1.0);
const int N = 1e3; struct abc{
    int d[6];
}; int n;
LL b[N+10][6];
abc temp1,temp2;
vector <LL> v; LL cal(abc temp1,abc temp2){
    LL ju = 0;
    rep1(i,1,5)
        ju += temp1.d[i]*temp2.d[i];
    return ju;
} int main(){
    //Open();
    //Close();
    ri(n);
    rep1(i,1,n)
        rep1(j,1,5)
            rl(b[i][j]);
    if (n>250){
        puts("0");
    }else{
        rep1(i,1,n){
            bool ok = true;
            rep1(j,1,n){
                if (i==j) continue;
                if (!ok) break;
                rep1(l,1,5) temp1.d[l] = b[j][l]-b[i][l];
                rep1(k,1,n){
                    if (j==k || i==k) continue;
                    rep1(l,1,5){
                        temp2.d[l] = b[k][l]-b[i][l];
                    }
                    if (cal(temp1,temp2)>0) {
                            ok = false;
                            break;
                    }
                }             }
            if (ok){
                v.pb(i);
            }
        }
        oi(sz(v));puts("");
        rep1(i,0,sz(v)-1){
            oi(v[i]),puts("");
        }
    }
    return 0;
}

【Codeforces Round #432 (Div. 1) A】 Five Dimensional Points的更多相关文章

  1. 【Codeforces Round #432 (Div. 1) B】Arpa and a list of numbers

    [链接]h在这里写链接 [题意] 定义bad list是一个非空的.最大公约数为1的序列.给定一个序列,有两种操作:花费x将一个元素删除.花费y将一个元素加1,问你将这个序列变为good list所需 ...

  2. 【Codeforces Round #432 (Div. 2) A】 Arpa and a research in Mexican wave

    [链接]h在这里写链接 [题意] 在这里写题意 [题解] t<=k,输出t t>=n,输出k-t+n 其他情况都是k [错的次数] 0 [反思] 在这了写反思 [代码] /* */ #in ...

  3. 【Codeforces Round #432 (Div. 2) B】Arpa and an exam about geometry

    [链接]h在这里写链接 [题意] 给你3个点A,B,C 问你能不能将纸绕着坐标轴上的一点旋转.使得A与B重合,B与C重合 [题解] 这3个点必须共圆. 则A,B,C不能为一条直线.否则无解. 共圆之后 ...

  4. 【Codeforces Round #420 (Div. 2) C】Okabe and Boxes

    [题目链接]:http://codeforces.com/contest/821/problem/C [题意] 给你2*n个操作; 包括把1..n中的某一个数压入栈顶,以及把栈顶元素弹出; 保证压入和 ...

  5. 【Codeforces Round #420 (Div. 2) B】Okabe and Banana Trees

    [题目链接]:http://codeforces.com/contest/821/problem/B [题意] 当(x,y)这个坐标中,x和y都为整数的时候; 这个坐标上会有x+y根香蕉; 然后给你一 ...

  6. 【Codeforces Round #420 (Div. 2) A】Okabe and Future Gadget Laboratory

    [题目链接]:http://codeforces.com/contest/821/problem/A [题意] 给你一个n*n的数组; 然后问你,是不是每个位置(x,y); 都能找到一个同一行的元素q ...

  7. 【Codeforces Round #423 (Div. 2) C】String Reconstruction

    [Link]:http://codeforces.com/contest/828/problem/C [Description] 让你猜一个字符串原来是什么; 你知道这个字符串的n个子串; 且知道第i ...

  8. 【Codeforces Round #423 (Div. 2) B】Black Square

    [Link]:http://codeforces.com/contest/828/problem/B [Description] 给你一个n*m的格子; 里面包含B和W两种颜色的格子; 让你在这个格子 ...

  9. 【Codeforces Round #423 (Div. 2) A】Restaurant Tables

    [Link]:http://codeforces.com/contest/828/problem/A [Description] 有n个组按照时间顺序来餐馆; 每个组由一个人或两个人组成; 每当有一个 ...

随机推荐

  1. 2008R2域控环境中 应用组策略 实现禁用USB设备使用

    本文介绍如何在Windows Server 2008 AD中禁用客户端USB端口.本文使用的系统:Windows Server 2008 R2 企业版.域功能级别:Windows Server 200 ...

  2. secureCRT 小技巧

    破解: keygen.exe 放到安装目录下填好姓名公司 ,patch后generate就行了 连接问题: 连接出现socket error很有可能是你的防火墙没关,今天排查了很久才发现是这个问题,浪 ...

  3. 紫书 例题 9-6 UVa 11400 (线性结构上的动态规划)

    这道题的下标从1开始比较方便,一方面前缀和算的方便一些,一方面涉及到前j 个灯泡,那么如果从0开始,前3个灯泡就是第0, 1, 2, 3个,非常奇怪. 所以灵活换下标. 然后这道题的动规有点暴力枚举的 ...

  4. 【Uva 10817】Headmaster's Headache

    [Link]: [Description] 一个学校,有s门课程(1<=s <=8),里面本身已经有m个老师了,然后还想招聘n个老师: 给出这m个老师和n个来应聘的老师的信息; (c[i] ...

  5. 使用UltraEdit配置多行注释和取消多行注释

    UltraEdit功能强大,使用方便,成为软件开发者必备的文档和代码编辑工具.有很多人也直接用它来写代码,如C/Java,脚本如:Perl/Tcl/JavaScript 等. 如果用来写代码,有一个不 ...

  6. Jetty 类载入问题处理

    前几日使用 Jetty (9.2)部署公司一个 web 项目,这个项目原本部署在 Tomcat server上,一切正常,可是部署到 Jetty 后,启动报错.关键错误信息为"java.la ...

  7. 【剑指Offer学习】【面试题27:二叉搜索树与双向链表】

    题目:输入一棵二叉搜索树,将该二叉搜索树转换成一个排序的双向链表.要求不能创建不论什么新的结点.仅仅能调整树中结点指针的指向. 比方输入图4.12 中左边的二叉搜索树,则输出转换之后的排序现向链表. ...

  8. Dojo Chart之经常使用统计图

    非常多做web的都知道,在非常多web系统中会涉及到一些统计图.比如饼状图,柱状图.趋势图.以及叠加图等.提到这儿,做web的都非常熟悉的,jquery的highcharts就能搞定全部的涉及到统计图 ...

  9. leetcode: Maximum Depth of Binary Tree

    Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the long ...

  10. NYOJ 203 三国志(Dijkstra+贪心)

    三国志 时间限制:3000 ms  |  内存限制:65535 KB 难度:5 描写叙述 <三国志>是一款非常经典的经营策略类游戏.我们的小白同学是这款游戏的忠实玩家.如今他把游戏简化一下 ...