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 SDK离线安装方法详解(加速安装)
AndroidSDK在国内下载一直很慢··有时候通宵都下不了一点点,最后只有选择离线安装,现在发出离线安装地址和方法,希望对大家有帮助 一,首先下载SDK的安装包,android-sdk_r10-wi ...
- 【Codeforces】Gym 101608G WiFi Password 二分+线段树
题意 给定$n$个数,求有最长的区间长度使得区间内数的按位或小于等于给定$v$ 二分区间长度,线段树处理出区间或,对每一位区间判断 时间复杂度$O(n\log n \log n)$ 代码 #inclu ...
- H5内容安全尺寸
设备独立像素:iPhone5:320 * 568 >> 微信网页可视区高度:504px iPhone6:375 * 667 >> 微信网页可视区高度:603px 设备独立像 ...
- 如何将 Python 程序打包成 .exe 文件?
有不少订阅本公众号的朋友都不是玩 Python,甚至都不是计算机相关专业的,当我给他们一个 Python 程序时,他们是完全不知道该怎么运行的. 于是我想是不是可以将我的程序打包成可执行文件,直接运行 ...
- 【LeetCode】039. Combination Sum
题目: Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all uniq ...
- Ubuntu——Python3.x——scikit-learn 安装
修改默认Python (默认的是Python2.7) rm -rf /usr/bin/python ln -s /usr/bin/ptyhon3 /usr/bin/python 安装所需依赖: apt ...
- [转]sql where 1=1和 0=1 的作用
sql where 1=1和 0=1 的作用 原文地址:http://www.cnblogs.com/junyuz/archive/2011/03/10/1979646.html where 1=1; ...
- AngularJs(Part 4)--Modules depending on other Modules
Angular does an excellent job of managing object dependencies. it can even take care of module depen ...
- ural 1500 Pass Licenses (状态压缩+dfs)
1500. Pass Licenses Time limit: 2.5 secondMemory limit: 64 MB A New Russian Kolyan believes that to ...
- java之字符串转换
参考http://how2j.cn/k/number-string/number-string-parse/317.html 数字转字符串 方法1: 使用String类的静态方法valueOf 方法2 ...