【推导】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为上顶点。那么其外接圆圆心即是一个合法的旋转中心。画个图很显然。

注意A,B,C三点共线时不可。

#include<cstdio>
using namespace std;
typedef long long ll;
struct Point{
	ll x,y;
	Point(const ll &x,const ll &y){
		this->x=x;
		this->y=y;
	}
	Point(){}
	ll len2(){
		return x*x+y*y;
	}
	void read(){
		scanf("%I64d%I64d",&x,&y);
	}
}a,b,c;
typedef Point Vector;
Vector operator - (const Point &a,const Point &b){
	return Vector(a.x-b.x,a.y-b.y);
}
ll Cross(const Vector &a,const Vector &b){
	return a.x*b.y-a.y*b.x;
}
int main(){
	a.read();
	b.read();
	c.read();
	if((a-b).len2()==(c-b).len2() && Cross(a-b,b-c)!=0){
		puts("Yes");
	}
	else{
		puts("No");
	}
	return 0;
}
posted @ 2017-09-05 13:09  AutSky_JadeK  阅读(105)  评论(0编辑  收藏  举报
TVアニメ「Charlotte(シャーロット)」公式サイト TVアニメ「Charlotte(シャーロット)」公式サイト