Clarke is a patient with multiple personality disorder. One day, Clarke turned into a learner of geometric. 
When he did a research with polygons, he found he has to judge if the polygon is a five-pointed star at many times. There are 5 points on a plane, he wants to know if a five-pointed star existed with 5 points given.

InputThe first line contains an integer T(1≤T≤10)T(1≤T≤10), the number of the test cases. 
For each test case, 5 lines follow. Each line contains 2 real numbers xi,yi(−109≤xi,yi≤109)xi,yi(−109≤xi,yi≤109), denoting the coordinate of this point.OutputTwo numbers are equal if and only if the difference between them is less than 10−410−4. 
For each test case, print YesYes if they can compose a five-pointed star. Otherwise, print NoNo. (If 5 points are the same, print YesYes. )Sample Input

2
3.0000000 0.0000000
0.9270509 2.8531695
0.9270509 -2.8531695
-2.4270509 1.7633557
-2.4270509 -1.7633557
3.0000000 1.0000000
0.9270509 2.8531695
0.9270509 -2.8531695
-2.4270509 1.7633557
-2.4270509 -1.7633557

Sample Output

Yes
No

Hint

我想了下,感觉这道题做法很多啊,判边判点的,但是一想还是觉得判边比较轻松,只要考率里面五条边相等,外面五条边相等就好了

#include<bits/stdc++.h>
using namespace std;
int main() {
int T,i,j;
double x[],y[],a[];
scanf("%d",&T);
while(T--) {
for(i=; i<; i++)
scanf("%lf%lf",&x[i],&y[i]);
int t=,f=;
for(i=; i<; i++)
for(j=; j<i; j++)
a[t++]=(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]);
sort(a,a+t);
for(i=; i<; i++)
if(i!=&&fabs(a[i]-a[i+])>0.0001) f=;
printf("%s\n",f?"Yes":"No");
}
return ;
}

Clarke and five-pointed star的更多相关文章

  1. all unicode

    Unicode Chart Range Decimal Name 0x0000-0x007F 0-127 Basic Latin 0x0080-0x00FF 128-255 Latin-1 Suppl ...

  2. 微信emoji的code

    const MAP = [        "\xc2\xa9" => 'COPYRIGHT SIGN',        "\xc2\xae" => ...

  3. 字体jquery ---

    You don’t need icons! Here are 100+ unicode symbols that you can use Danny Markov December 3rd, 2014 ...

  4. QQ表情代码大全,你知道几个??

    很久没有给大家分享代码了,今天趁着有点时间来给大家分享一下QQ空间的表情代码!不用感谢我,大家拿去用吧! [em]e100[/em] 微笑bai[em]e101[/em] 撇嘴[em]e102[/em ...

  5. hdu 5563 Clarke and five-pointed star 水题

    Clarke and five-pointed star Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/show ...

  6. 时隔一年再读到the star

    The Star Arthur C. Clarke It is three thousand light-years to the Vatican. Once, I believed that spa ...

  7. BC-Clarke and five-pointed star(水)

    Clarke and five-pointed star Accepts: 237 Submissions: 591 Time Limit: 2000/1000 MS (Java/Others) Me ...

  8. HDU_5563Clarke and five-pointed star

    Clarke and five-pointed star Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K ( ...

  9. hdoj--5563--Clarke and five-pointed star(简单几何)

    Clarke and five-pointed star Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K ( ...

随机推荐

  1. [LR]遇到的坑及常用技巧

    解决问题是需要智慧的 1.LR内部问题可以查看帮助文档 一般位于LR安装目录的bin目录下,如下图 打开Troubleshooting.chm文件,比如我们跑场景的过程中报错,报错信息为:-27995 ...

  2. ES6, Angular,React和ABAP中的String Template(字符串模板)

    String Template(字符串模板)在很多编程语言和框架中都支持,是一个很有用的特性.本文将Jerry工作中使用到的String Template的特性做一个总结. ES6 阮一峰老师有一个专 ...

  3. Android(java)学习笔记113:Activity的生命周期

    1.首先来一张生命周期的总图: onCreate():创建Acitivity界面       onStart():让上面创建的界面可见              onResume():让上面创建的界面 ...

  4. vue props 传入对象Object,如果外层更改属性,默认里面是不更新,需要使用 this.$set(this.datese1, 'xsfaDateYear1', '')

    vue props 传入对象Object,如果外层更改属性,默认里面是不更新,需要使用 this.$set(this.datese1, 'xsfaDateYear1', '')

  5. Bootstrap 下拉菜单(dropdown)插件

    使用下拉菜单的插件,您可以向任何组件(比如:导航栏,标签页,胶囊式导航,按钮)添加下拉菜单 用法 您可以切换下拉菜单(dropdown)插件隐藏内容 1.通过data属性,向链接或按钮添加data-t ...

  6. Eclipse+Tomcat搭建jsp服务器

    首先,安装java sdk 环境,这里就不多说了,附上java sdk的下载地址:http://www.oracle.com/technetwork/java/javase/downloads/jdk ...

  7. iOS9适配总结

    每年iOS升级,都会带来一些坑,这次iOS9也不例外.本文总结了微信在适配iOS9上遇到的问题和解决方案. 一.iOS9问题汇总   1. 编译问题(Bitcode) 大部分人升级到Xcode7后,首 ...

  8. css3中的nth-child和nth-of-type的区别

    实例: 首先创建一个HTML结构 <div class="post"> <p>我是文章的第一段落</p> <p>我是文章的第二段落& ...

  9. 【启发式搜索】Codechef March Cook-Off 2018. Maximum Tree Path

    有点像计蒜之道里的 京东的物流路径 题目描述 给定一棵 N 个节点的树,每个节点有一个正整数权值.记节点 i 的权值为 Ai.考虑节点 u 和 v 之间的一条简单路径,记 dist(u, v) 为其长 ...

  10. http客户端与浏览器的区别

    两者区别:浏览器对http响应头会进行特定处理(如自动读取本地缓存.设置cookie等),而http客户端(如crul)可能没有像浏览器那样的处理,某些封装程度高的http客户端,可能会有. 同一个文 ...