【链接】h在这里写链接


【题意】


给你3个点A,B,C
问你能不能将纸绕着坐标轴上的一点旋转。使得A与B重合,B与C重合

【题解】


这3个点必须共圆。
则A,B,C不能为一条直线。否则无解。
共圆之后.角AOB必须等于角BOC.也即等价于|AB|=|AC|
(圆周角定理)
判断|AB|==|AC|之后,判断一下B是不是A和C的中点,就能排除在一条线上的情况。
(中点只会涉及到整数。可以避免double的误差)

【错的次数】


3

【反思】


能用整数判断,都尽量用整数判断。
整数不会有误差!

【代码】

  1. /*
  2.  
  3. */
  4. #include <cstdio>
  5. #include <iostream>
  6. #include <algorithm>
  7. #include <cstring>
  8. #include <vector>
  9. #include <map>
  10. #include <queue>
  11. #include <iomanip>
  12. #include <set>
  13. #include <cstdlib>
  14. #include <cmath>
  15. #include <bitset>
  16. using namespace std;
  17. #define lson l,m,rt<<1
  18. #define rson m+1,r,rt<<1|1
  19. #define LL long long
  20. #define rep1(i,a,b) for (int i = a;i <= b;i++)
  21. #define rep2(i,a,b) for (int i = a;i >= b;i--)
  22. #define mp make_pair
  23. #define pb emplace_back
  24. #define fi first
  25. #define se second
  26. #define ld long double
  27. #define ms(x,y) memset(x,y,sizeof x)
  28. #define ri(x) scanf("%d",&x)
  29. #define rl(x) scanf("%lld",&x)
  30. #define rs(x) scanf("%s",x)
  31. #define rf(x) scnaf("%lf",&x)
  32. #define oi(x) printf("%d",x)
  33. #define ol(x) printf("%lld",x)
  34. #define oc putchar(' ')
  35. #define os(x) printf(x)
  36. #define all(x) x.begin(),x.end()
  37. #define Open() freopen("F:\\rush.txt","r",stdin)
  38. #define Close() ios::sync_with_stdio(0)
  39. #define sz(x) ((int) x.size())
  40. #define ld long double
  41.  
  42. typedef pair<int,int> pii;
  43. typedef pair<LL,LL> pll;
  44.  
  45. //mt19937 myrand(time(0));
  46. //int get_rand(int n){return myrand()%n + 1;}
  47. const int dx[9] = {0,1,-1,0,0,-1,-1,1,1};
  48. const int dy[9] = {0,0,0,-1,1,-1,1,-1,1};
  49. const double pi = acos(-1.0);
  50. const int N = 110;
  51.  
  52. LL ax,ay,bx,by,cx,cy;
  53.  
  54. LL sqr(LL x){
  55.     return x*x;
  56. }
  57.  
  58. LL dis(LL x1,LL y1,LL x2,LL y2){
  59.     return sqr(x2-x1)+sqr(y2-y1);
  60. }
  61.  
  62. int main(){
  63.     //Open();
  64.     //Close();
  65.     cin >> ax >> ay >> bx >> by >> cx >> cy;
  66.     LL C = dis(ax,ay,bx,by);
  67.     LL A = dis(bx,by,cx,cy);
  68.     LL B = dis(ax,ay,cx,cy);
  69.     if (C==A){
  70.         if ( (ax+cx)==2*bx && (ay+cy)==2*by)
  71.             puts("No");
  72.         else
  73.             puts("Yes");
  74.     }else
  75.         puts("No");
  76.     return 0;
  77. }

【Codeforces Round #432 (Div. 2) B】Arpa and an exam about geometry的更多相关文章

  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. 1) A】 Five Dimensional Points

    [链接]点击打开链接 [题意] 给你n个5维的点. 然后让你以其中的某一个点作为起点a. 另选两个点b,c. 组成向量a->b,a->c 如果所有的a->b和a->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. 威联通212P 在admin用户密码正确情况下仍然无法登录WEB页面解决办法

    *登录 telnet 执行以下语句: [~] # cp /etc/default_config/passwd /mnt/HDA_ROOT/.config/passwd[~] # cp /etc/def ...

  2. webpack4强势来袭

    # Webpack4## 安装> webpack 4默认不需要配置文件(它吸收了Parcel的思想,零配置)> - npm i -D webpack> - npm i -D webp ...

  3. Scrapy 框架介绍

    Scrapy 框架 Scrapy,Python开发的一个快速.高层次的屏幕抓取和web抓取框架,用于抓取web站点并从页面中提取结构化的数据.Scrapy用途广泛,可以用于数据挖掘.监测和自动化测试. ...

  4. WPF中Image控件的Source属性

    原文:WPF中Image控件的Source属性 imgBook 是一个Image控件,在后台代码中我想给它指定Source的属性.我先如下方式进行: Uri uri = new Uri(strImag ...

  5. Swift学习笔记(9)--闭包

    1.闭包表达式: { (parameters) -> returnType in statements } 注1.闭包表达式语法可以使用常量.变量和inout类型作为参数,不提供默认值. 也可以 ...

  6. 比MD5 和HMAC还要安全的加密 - MD5 加时间戳

    //1.给一个字符串进行MD5加密 NSString *passKey = @"myapp"; passKey = [passKey md5String]; //2.对第一步中得到 ...

  7. Linq复杂对象查询

    复杂的查询对象, using System; using System.Collections.Generic; using System.Linq; using System.Text; using ...

  8. Day2上午解题报告

    预计分数:100+0+60=160 实际分数:100+0+60=160 mmpT1数据错了... T1遭遇 题目描述 你是能看到第一题的 friends呢. —— hja ?座楼房,立于城中 . 第? ...

  9. How to anti-Obfuscated code

    Author:jin can zhu from China Source:http://blog.csdn.net/clever101 Now many software makers have us ...

  10. IDC机房KVM应用案例分析

    IDC机房KVM应用案例分析 一.背景介绍 随着信息技术的发展,各行各业都在马不停蹄的开展着各自的信息化建设步伐.对于设计制造创新科技产品为运行主业的设计院而言,内部IT基础设备与机房管理结构的完善与 ...