cf 18a Triangle
来源:互联网 发布:北京行知实验小学 编辑:程序博客网 时间:2024/05/16 04:23
#include <iostream>#include <cstdio>#include <algorithm>using namespace std;int dir[4][2]={-1,0,1,0,0,-1,0,1};int x[4],y[4];int a[4];int get(int a1,int b1,int a2,int b2){ return (a1-a2)*(a1-a2)+(b1-b2)*(b1-b2);}int main(){ int flag=0; scanf("%d%d%d%d%d%d",&x[1],&y[1],&x[2],&y[2],&x[3],&y[3]); a[1]=get(x[1],y[1],x[2],y[2]); a[2]=get(x[1],y[1],x[3],y[3]); a[3]=get(x[2],y[2],x[3],y[3]); sort(a+1,a+4); if(a[1]+a[2]==a[3]) { printf("RIGHT\n"); return 0; } else { for(int i=1;i<=3;i++) { for(int j=0;j<4;j++) { x[i]+=dir[j][0]; y[i]+=dir[j][1]; a[1]=get(x[1],y[1],x[2],y[2]); a[2]=get(x[1],y[1],x[3],y[3]); a[3]=get(x[2],y[2],x[3],y[3]); sort(a+1,a+4); if(a[1]!=0&&a[1]+a[2]==a[3]) { printf("ALMOST\n"); return 0; } x[i]-=dir[j][0]; y[i]-=dir[j][1]; } } } printf("NEITHER\n"); return 0;}
0 0
- cf 18a Triangle
- CF 6 A - Triangle
- CF 407A - Triangle
- CF 407A Triangle
- cf 6a Triangle
- CF 6A Triangle (判断三角形)
- CF:Triangle
- CF#195(div2) A:Vasily the Bear and Triangle
- CF 336A(Vasily the Bear and Triangle-推公式)
- CF 6A——比赛 I - Triangle
- CF 6A Triangle (判断能否构成三角形)
- codeforces 18A - Triangle
- CodeForces 18A Triangle
- CodeForces 18A A - Triangle
- CF 239 C Triangle
- 【水枚举】#18 A. Triangle
- CodeForces 18A Triangle (几何)
- A. Triangle
- HDU 3652
- The Cloud Security Ecosystem: Technical, Legal, Business and Management Issues
- 又见导弹拦截 nyoj 814
- 【已解决】Genymotion, “Unable to load VirtualBox engine”
- codeforces585D. Lizard Era: Beginning
- cf 18a Triangle
- iOS: 通过addChildViewController实现 Segment 下的 View 的切换
- 硬盘和显卡的访问与控制(一)——《x86汇编语言:从实模式到保护模式》读书笔记01
- 杭电-2639Bone Collector II
- ASCII排序 nyoj4
- 需求分析过程
- sql 存储过程 循环
- R12.1.3 应用克隆过程中autocfg脚本报错
- 日语五十音图