Codeforces 851 B Arpa and an exam about geometry
来源:互联网 发布:python classmethod 编辑:程序博客网 时间:2024/05/21 10:50
题目地址
题意:给你3个点的坐标,问在这个平面内能不能找到一个点,3个点围绕这个点同时选择同一角度,使得旋转以后a点在原来b点的位置,旋转以后b点在原来c点的位置。
思路:画图就会发现,只有当这三个点在同一个圆上面,并且ab==bc就是可以找到的。因为在圆上面等长的弦对应的弧是等长的,绕圆心旋转是一定能重合的。看下图:
然后因为是圆,所以不能为同一斜率,记住最好不要用double,因为如果你算长度的时候用了sqrt,可能精度就不好处理了。
#include <iostream>#include <cstring>#include <string>#include <queue>#include <vector>#include <map>#include <set>#include <stack>#include <cmath>#include <cstdio>#include <algorithm>#include <iomanip>#define N 1000010#define M 4000010#define LL __int64#define inf 0x7f7f7f7f#define lson l,mid,ans<<1#define rson mid+1,r,ans<<1|1#define getMid (l+r)>>1#define movel ans<<1#define mover ans<<1|1using namespace std;LL solve(LL a, LL b, LL x, LL y) { return (a - x)*(a - x) + (b - y)*(b - y);}bool check(LL a, LL b, LL c, LL d, LL e, LL f){ if ((d - b)*(e - c) == (f - d)*(c - a)) return 0; return 1;}int main() { cin.sync_with_stdio(false); double ab, ac, bc; LL ax, ay, bx, by, cx, cy; while (cin >> ax >> ay >> bx >> by >> cx >> cy) { if (solve(ax, ay, bx, by) == solve(bx, by, cx, cy) && check(ax, ay, bx, by, cx, cy)) { cout << "Yes" << endl; } else { cout << "No" << endl; } } return 0;}
阅读全文
0 0
- codeforces 851B Arpa and an exam about geometry
- codeforces 851 B. Arpa and an exam about geometry
- Codeforces 851 B Arpa and an exam about geometry
- Codeforces Round #432 B. Arpa and an exam about geometry
- Codeforces Round#432 B. Arpa and an exam about geometry
- Codeforces Round #432 B. Arpa and an exam about geometry
- B. Arpa and an exam about geometry
- codeforce 851 B Arpa and an exam about geometry(思路)
- Codeforces 851B && Round #432 Div. 2 B. Arpa and an exam about geometry
- Codeforces 851B. Arpa and an exam about geometry 计算几何,结论题
- Div#432B Arpa and an exam about geometry
- Codeforces Round #432 Div2 B. Arpa and an exam about geometry
- codeforces Div#432 B Arpa and an exam about geometry(技巧)
- Codeforces Round #432 (Div. 2) B Arpa and an exam about geometry
- Codeforces Round #432 (Div. 2) B. Arpa and an exam about geometry(数学水题)
- codeforces Round4 B. Before an Exam
- Codeforces 4B Before an Exam
- codeforces 4B Before an Exam
- 回调机制
- 4、重识MySQL-MySQL命令之编码处理
- linux常用命令
- (2)基于Echarts插件的多维数据可视化设计和实现
- 安全体系(二)——RSA算法详解
- Codeforces 851 B Arpa and an exam about geometry
- HDU 6095 Rikka with Competition(水~)
- oracle中exp,imp(导入,导出)的使用详解
- 罗马和阿拉伯数字相互转换
- WOJ1203-找相同
- 剑指offer_不用加减乘数做加法
- 多研究些架构,少谈些框架(3)-- 微服务和事件驱动
- Spark性能优化——高性能序列化类库
- jquery判断页面滚动条(scroll)是上滚还是下滚,且是否滚动到头部或者底部