【链接】点击打开链接


【题意】


给你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考虑了。
是不是它能缩小?
是不是它是没有用的?

【代码】

  1. #include <cstdio>
  2. #include <iostream>
  3. #include <algorithm>
  4. #include <cstring>
  5. #include <vector>
  6. #include <map>
  7. #include <queue>
  8. #include <iomanip>
  9. #include <set>
  10. #include <cstdlib>
  11. #include <cmath>
  12. #include <bitset>
  13. using namespace std;
  14. #define lson l,m,rt<<1
  15. #define rson m+1,r,rt<<1|1
  16. #define LL long long
  17. #define rep1(i,a,b) for (int i = a;i <= b;i++)
  18. #define rep2(i,a,b) for (int i = a;i >= b;i--)
  19. #define mp make_pair
  20. #define pb emplace_back
  21. #define fi first
  22. #define se second
  23. #define ld long double
  24. #define ms(x,y) memset(x,y,sizeof x)
  25. #define ri(x) scanf("%d",&x)
  26. #define rl(x) scanf("%lld",&x)
  27. #define rs(x) scanf("%s",x)
  28. #define rf(x) scnaf("%lf",&x)
  29. #define oi(x) printf("%d",x)
  30. #define ol(x) printf("%lld",x)
  31. #define oc putchar(' ')
  32. #define os(x) printf(x)
  33. #define all(x) x.begin(),x.end()
  34. #define Open() freopen("F:\\rush.txt","r",stdin)
  35. #define Close() ios::sync_with_stdio(0)
  36. #define sz(x) ((int) x.size())
  37. #define ld long double
  38.  
  39. typedef pair<int,int> pii;
  40. typedef pair<LL,LL> pll;
  41.  
  42. //mt19937 myrand(time(0));
  43. //int get_rand(int n){return myrand()%n + 1;}
  44. const int dx[9] = {0,1,-1,0,0,-1,-1,1,1};
  45. const int dy[9] = {0,0,0,-1,1,-1,1,-1,1};
  46. const double pi = acos(-1.0);
  47. const int N = 1e3;
  48.  
  49. struct abc{
  50.     int d[6];
  51. };
  52.  
  53. int n;
  54. LL b[N+10][6];
  55. abc temp1,temp2;
  56. vector <LL> v;
  57.  
  58. LL cal(abc temp1,abc temp2){
  59.     LL ju = 0;
  60.     rep1(i,1,5)
  61.         ju += temp1.d[i]*temp2.d[i];
  62.     return ju;
  63. }
  64.  
  65. int main(){
  66.     //Open();
  67.     //Close();
  68.     ri(n);
  69.     rep1(i,1,n)
  70.         rep1(j,1,5)
  71.             rl(b[i][j]);
  72.     if (n>250){
  73.         puts("0");
  74.     }else{
  75.         rep1(i,1,n){
  76.             bool ok = true;
  77.             rep1(j,1,n){
  78.                 if (i==j) continue;
  79.                 if (!ok) break;
  80.                 rep1(l,1,5) temp1.d[l] = b[j][l]-b[i][l];
  81.                 rep1(k,1,n){
  82.                     if (j==k || i==k) continue;
  83.                     rep1(l,1,5){
  84.                         temp2.d[l] = b[k][l]-b[i][l];
  85.                     }
  86.                     if (cal(temp1,temp2)>0) {
  87.                             ok = false;
  88.                             break;
  89.                     }
  90.                 }
  91.  
  92.             }
  93.             if (ok){
  94.                 v.pb(i);
  95.             }
  96.         }
  97.         oi(sz(v));puts("");
  98.         rep1(i,0,sz(v)-1){
  99.             oi(v[i]),puts("");
  100.         }
  101.     }
  102.     return 0;
  103. }

【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. Ubuntu 16.04 实现有线 无线同时用

    因为工作的原因,经常会用有线网卡连接服务器进行配置,无线网卡上外网. 一.查看当前网关信息 pipci@ubuntu:~$ ip route showdefault via 192.168.2.1 d ...

  2. ES6学习笔记(一)新的变量定义命令let和const

    1.一些历史 ES6(ECMAScript 6.0)是 JavaScript 语言的新一代标准,于2015 年 6 月正式发布,距今已经4年了,它的目标,是使得 JavaScript 语言可以用来编写 ...

  3. 封装TensorFlow神经网络

    为了参加今年的软件杯设计大赛,这几个月学习了很多新知识.现在大赛的第二轮作品优化已经提交,开始对这四个月所学知识做一些总结与记录. 用TensorFlow搭建神经网络.TensorFlow将神经网络的 ...

  4. 【Uva 307】Sticks

    [Link]: [Description] 给你最多n个棍子; (n< = 64) 每根棍子长度(1..50) 问你这n根棍子,可以是由多少根长度为x的棍子分割出来的; x要求最小 [Solut ...

  5. hiho week 38 P1 : 二分·二分答案

    P1 : 二分·二分答案 Time Limit:10000ms Case Time Limit:1000ms Memory Limit:256MB 描述 在上一回和上上回里我们知道Nettle在玩&l ...

  6. 流媒体技术 rtp/rtcp/rtsp资料精华!

     流媒体技术 rtp/rtcp/rtsp资料精华! 流媒体技术 流媒体是指在网络中使用流式(Sreaming)传输技术进行传输的连续时基媒体.如音频数据流或视频数据流,而不是一种新的媒体.流媒体技 ...

  7. CI框架源代码阅读笔记6 扩展钩子 Hook.php

    CI框架同意你在不改动系统核心代码的基础上加入或者更改系统的核心功能(如重写缓存.输出等). 比如,在系统开启hook的条件下(config.php中$config['enable_hooks'] = ...

  8. 56.lambda表达式与绑定以及伪函数和绑定

    #include <iostream> #include <functional> using namespace std; using namespace std::plac ...

  9. 【Henu ACM Round #12 B】 Alice, Bob, Two Teams

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 写个前缀和 和 一个后缀和. (即前i个字符A所代表的数字的和以及前i个字符B所代表的数字的和.. 然后枚举前i个字符翻转. 求B对 ...

  10. Windows学习总结(4)——Host文件的作用和如何修改Host文件

    本经验将为您介绍,什么是Host文件,Host文件作用,Host文件的位置等信息,以帮忙您了解Host文件. 方法/步骤 什么是HOST文件: Hosts是一个没有扩展名的系统文件,其基本作用就是将一 ...