Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017) B
Arpa is taking a geometry exam. Here is the last problem of the exam.
You are given three points a, b, c.
Find a point and an angle such that if we rotate the page around the point by the angle, the new position of a is the same as the old position of b, and the new position of b is the same as the old position of c.
Arpa is doubting if the problem has a solution or not (i.e. if there exists a point and an angle satisfying the condition). Help Arpa determine if the question has a solution or not.
The only line contains six integers ax, ay, bx, by, cx, cy (|ax|, |ay|, |bx|, |by|, |cx|, |cy| ≤ 109). It's guaranteed that the points are distinct.
Print "Yes" if the problem has a solution, "No" otherwise.
You can print each letter in any case (upper or lower).
0 1 1 1 1 0
Yes
1 1 0 0 1000 1000
No
In the first sample test, rotate the page around (0.5, 0.5) by .
In the second sample test, you can't find any solution.
题意:三个点,从A B C找到一个圆形,通过旋转可以使得A到B这个位置,B到C这个位置
解法:
1 AB BC距离相等
2 大概想到是一个.....扇子..不能符合条件的只有三点共线的情况
#include<bits/stdc++.h>
using namespace std;
struct Node{
long long x,y;
}node[];
long long dis(Node a,Node b){
return (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);
}
int main(){
for(int i=;i<=;i++){
cin>>node[i].x>>node[i].y;
} long long a=(node[].x-node[].x)*(node[].y-node[].y);
long long b=(node[].y-node[].y)*(node[].x-node[].x);
if(a!=b&&(dis(node[],node[])==dis(node[],node[]))){
cout<<"Yes"<<endl;
}else{
cout<<"No"<<endl;
}
return ;
}
Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017) B的更多相关文章
- D. Arpa and a list of numbers Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017)
http://codeforces.com/contest/851/problem/D 分区间操作 #include <cstdio> #include <cstdlib> # ...
- Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017)ABCD
A. Arpa and a research in Mexican wave time limit per test 1 second memory limit per test 256 megaby ...
- Codeforces Round #432 (Div. 1, based on IndiaHacks Final Round 2017) D. Tournament Construction(dp + 构造)
题意 一个竞赛图的度数集合是由该竞赛图中每个点的出度所构成的集合. 现给定一个 \(m\) 个元素的集合,第 \(i\) 个元素是 \(a_i\) .(此处集合已经去重) 判断其是否是一个竞赛图的度数 ...
- 【前缀和】【枚举倍数】 Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017) D. Arpa and a list of numbers
题意:给你n个数,一次操作可以选一个数delete,代价为x:或者选一个数+1,代价y.你可以进行这两种操作任意次,让你在最小的代价下,使得所有数的GCD不为1(如果全删光也视作合法). 我们从1到m ...
- 【推导】【暴力】Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017) C. Five Dimensional Points
题意:给你五维空间内n个点,问你有多少个点不是坏点. 坏点定义:如果对于某个点A,存在点B,C,使得角BAC为锐角,那么A是坏点. 结论:如果n维空间内已经存在2*n+1个点,那么再往里面添加任意多个 ...
- 【推导】Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017) B. Arpa and an exam about geometry
题意:给你平面上3个不同的点A,B,C,问你能否通过找到一个旋转中心,使得平面绕该点旋转任意角度后,A到原先B的位置,B到原先C的位置. 只要A,B,C构成等腰三角形,且B为上顶点.那么其外接圆圆心即 ...
- Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017) D
Arpa has found a list containing n numbers. He calls a list bad if and only if it is not empty and g ...
- Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017) C
You are given set of n points in 5-dimensional space. The points are labeled from 1 to n. No two poi ...
- Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017) A
Arpa is researching the Mexican wave. There are n spectators in the stadium, labeled from 1 to n. Th ...
随机推荐
- 织梦简洁机械设备dedecms模板
织梦简洁机械设备dedecms模板,个人网站模板,dedecms模板. 模板地址:http://www.huiyi8.com/sc/7269.html
- ACM学习历程——HDU 5014 Number Sequence (贪心)(2014西安网赛)
Description There is a special number sequence which has n+1 integers. For each number in sequence, ...
- c# namespace不能和class的name 相同
比如namespace A, 内部Class A, 那么调用class A的方法只能通过A.A.XXX来访问. 或者说实例化一个class A, A a = new A(); // compile ...
- Ubuntu——Python3.x——scikit-learn 安装
修改默认Python (默认的是Python2.7) rm -rf /usr/bin/python ln -s /usr/bin/ptyhon3 /usr/bin/python 安装所需依赖: apt ...
- Scala学习——集合的使用和“_”的一些使用(中)
1.空格加_可以表示函数的原型 命令行代码: scala> def fun1(name:String){println(name)} fun1: (name: String)Unit scala ...
- JAVA 编程思想二
1: java 单根继承的优点? 方便垃圾回收: 垃圾回收的设计会方便实现. 多重继承的函数重名的问题. 2: 向下转型和向上转型? 向下转型不安全,向上转型安全. 3: system.g ...
- Scala Beginner
开始学习Scala,下面的内容大部分从Scala官网翻译过来,有几个地方翻译的不是很好,表述不清楚的地方大家可以浏览Scala官网,多指教. Scala offical website is http ...
- Http协议-概要
Http协议(超文本传输协议)是位于TCP/IP结构中的应用层的一种传输协议,规定了万维网服务器之间相互通信的规则.比如比较常见的Web浏览器客户端与应用服务器的通信!万维网服务器之间互相通信的时候往 ...
- 【hdu4570】Multi-bit Trie 区间DP
标签: 区间dp hdu4570 http://acm.hdu.edu.cn/showproblem.php?pid=4570 题意:这题题意理解变态的.转自大神博客: 这题题意确实有点难懂,起码对于 ...
- Javascript实现页面左边的菜单选中项高亮显示
在项目开发过程中,遇到一个问题 在一个模板页面中,Layout.cshtml,页面左边放了一个菜单项menu,每一项都是一个链接到一个新的页面.但所有页面都是用这个模板Layout.cshtml.需要 ...