Codeforces Round #432 (Div. 2) B. Arpa and an exam about geometry(数学水题)
来源:互联网 发布:东华软件金融部 编辑:程序博客网 时间:2024/05/31 00:40
题解:
比赛还在进行但是我已经写不动了,10分钟过a题(太水不想写题解),20分钟过b题。。c题看不懂,d题不会做,e题。。。算了吧,虽然这题很水但还是水一发博客
题意:
给你3个点的坐标,问你是否能找到一个点,以该点为中心旋转一定的角度使得a与b重合,b与c重合
思路:
直接判断只要两个线段长度相同而且三个点不在同一直线上就行了
ps:
这题之前用double型40组数据出错估计是因为double精度不够,还有就是斜率不存在的时候会出问题,把数据类型改成long long,把斜率判等写成乘法就好了
暂时ac的代码:
#include<iostream>#include<cstring>#include<stdio.h>#include<math.h>#include<string>#include<stdio.h>#include<queue>#include<stack>#include<map>#include<vector>#include<deque>#include<algorithm>using namespace std;#define INF 100861111#define ll long long#define eps 1e-7#define maxn 20int main(){ long long x1,y1,x2,y2,x3,y3,k1,k2,d1,d2; scanf("%lld%lld%lld%lld%lld%lld",&x1,&y1,&x2,&y2,&x3,&y3); d1=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2); d2=(x2-x3)*(x2-x3)+(y2-y3)*(y2-y3); if(d1!=d2) { printf("No\n"); return 0; } if((x2-x3)*(y1-y2)==(x1-x2)*(y2-y3)) { printf("No\n"); } else printf("Yes\n"); return 0;}
阅读全文
0 0
- Codeforces Round #432 (Div. 2) B. Arpa and an exam about geometry(数学水题)
- Codeforces 851B && Round #432 Div. 2 B. Arpa and an exam about geometry
- Codeforces Round #432 (Div. 2) 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
- codeforces Div#432 B 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 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
- B. Arpa and an exam about geometry
- Codeforces 851B. Arpa and an exam about geometry 计算几何,结论题
- codeforce 851 B Arpa and an exam about geometry(思路)
- Codeforces Round #383 (Div. 2) A. Arpa’s hard exam and Mehrdad’s naive cheat(水题)
- Codeforces Round #383 (Div. 2) A. Arpa’s hard exam and Mehrdad’s naive cheat(快速幂水题)
- Codeforces Round #383 (Div. 2) B. Arpa’s obvious problem and Mehrdad’s terrible solution 数学
- 达夫设备(Duff`s Device)减少迭代次数
- Angular CLI 使用教程指南参考
- LeetCode——105. Construct Binary Tree from Preorder and Inorder Traversal
- 反转单链表
- 简单线程池实现原理
- Codeforces Round #432 (Div. 2) B. Arpa and an exam about geometry(数学水题)
- 几种常见加密算法解析及使用
- UVALive 4764 Bing it(dp)
- Linux的system()和popen()差异
- HTML表格颜色搭配+柱状图颜色搭配+HTML柱状图实现
- Windows Message Queue
- 引用参数传递
- NDK开发——FFmpeg在Linux下编译、测试编译结果
- hello!以后就在这里分享自己的学习进度和成果