Codeforces Round #432 (Div. 2) B Arpa and an exam about geometry

来源:互联网 发布:喜马拉雅听书 知乎 编辑:程序博客网 时间:2024/06/07 11:48

题目链接:点击打开链接

即判断是否存在一个点d,使∠adb等于∠bdc

那么只要作ab,bc的中垂线判断其是否有交点

再判断ab,bc是否等长即可

AC代码如下:

#include <iostream>#include <cmath>using namespace std;struct point{    double x, y;};point a, b, c;double dis(point a, point b){    double temp=(a.x - b.x)*(a.x - b.x) + (a.y-b.y)*(a.y-b.y);    return sqrt(temp);}int onLine(point a, point b, point c){    return (a.x-b.x)*(c.y-b.y)==(a.y-b.y)*(c.x-b.x);}int main(){    ios::sync_with_stdio(0);    cin.tie(0);    while(cin>>a.x>>a.y)    {        cin>>b.x>>b.y>>c.x>>c.y;        if(!onLine(a,b,c)&&dis(a,b)==dis(b,c))  cout<<"Yes"<<endl;        else cout<<"No"<<endl;    }    return 0;}



阅读全文
0 0
原创粉丝点击