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 ...
随机推荐
- Android窗口系统第三篇---WindowManagerService中窗口的组织方式
Android窗口系统第一篇—Window的类型与Z-Order确定 Android窗口系统第二篇—Window的添加过程 上面文章梳理了一个窗口的添加过程,系统中有很多应用,每个应用有多个Activ ...
- python做图笔记
1. 工具选择 了解了基本python,rodeo,anaconda套件这三种工具. (1)基本python,下载安装python的最新版(目前是python3.7).注意要使用安装版.安装好后,一般 ...
- linux 加载raid驱动
Driver Disk Installation Guide for ARC-11XX/ARC12XX/ARC16XX/18XX RAID Controller on RHEL 5.11 or Cen ...
- 集训Day13
我这个肥宅一点都不快乐嘤嘤嘤 bzoj3456 求n个点的无向简单连通图的个数 我们可以用容斥推出递推式 首先我们令为 于是有 这样就是可以用CDQ分治解决的一类递推式了 不是那么明显的变形一下得到 ...
- 集训Day10
果然颓的不像话 bzoj3680 gty又虐了一场比赛,被虐的蒟蒻们决定吊打gty.gty见大势不好机智的分出了n个分身,但还是被人多势众的蒟蒻抓住了.蒟蒻们将n个gty吊在n根绳子上,每根绳子穿过天 ...
- HihoCoder1333 :平衡树(splay+lazy)(区间加值,区间删除)
描述 小Ho:好麻烦啊~~~~~ 小Hi:小Ho你在干嘛呢? 小Ho:我在干活啊!前几天老师让我帮忙管理一下团队的人员,但是感觉好难啊. 小Hi:说来听听? 小Ho:事情是这样的.我们有一个运动同好会 ...
- 瞎写的树dfs序
这里枚举了树的DFS序来解决树上问题的多个板子,自己最好多看看. ↓改↓ ↓求↓ 点 点 ————————>>>这个就算了 点 树 简单, BIT 点 链 重点! 树 树 简单, 线 ...
- hdu3739 Anti LIS[最小割]
长度为 n≤1000 的数列 ai,其中最长上升子序列的长度为 s.至少删去多少数使得最长上升子序列的长度小于 s. 其实这题和那个求有多少不重叠LIS是一样答案的. 先放个图. 图丑别说我. 原网络 ...
- Microsoft SQL Server 数据库
1. master 数据库 master 数据库记录 SQL Server 系统的所有系统级别信息.它记录所有的登录帐户和系统配置设置.master 数据库是这样一个数据库,它记录所有其它的数据库,其 ...
- C# 架构模式
单例模式 (Singleton) 单例讲的是当一个类被初次调用时,会产生一个类的实例, 而这个类的实例会贯穿程序的整个生命周期.单例提供了一个全局.唯一的实例. 步骤:1.让类自己创建一个实例:2.提 ...