HDU 5206 Four Inages Strategy
来源:互联网 发布:精准扶贫平台 网络 编辑:程序博客网 时间:2024/05/18 00:42
#include "string"#include "iostream"#include "cstdio"#include "cmath"#include "set"#include "queue"#include "vector"#include "cctype"#include "sstream"#include "cstdlib"#include "cstring"#include "stack"#include "ctime"#include "algorithm"#define pa pair<int,int>#define Pi M_PI#define INF 0x3f3f3f3f#define INFL 0x3f3f3f3f3f3f3f3fLLusing namespace std;typedef long long LL;const int M=15;LL x[M],y[M],z[M];LL dist(int i,int j){ return (x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])+(z[i]-z[j])*(z[i]-z[j]);}struct node{ LL d; int id;}dis[100];int cmp(node a,node b){ return a.d<b.d;}int main(){ int t,cas=0; scanf("%d",&t); while(t--) { for(int i=1;i<=4;i++) { cin>>x[i]>>y[i]>>z[i]; } int h=0; for(int i=1;i<4;i++) { for(int j=i+1;j<=4;j++) { dis[++h].d=dist(i,j); } } sort(dis+1,dis+1+h,cmp); int flag=0; for(int i=2;i<=4;i++) { if(dis[i].d!=dis[i-1].d)flag=1; } if(dis[5].d!=dis[4].d*2 || dis[6].d!=dis[5].d)flag=1; if(flag)printf("Case #%d: No\n",++cas);else printf("Case #%d: Yes\n",++cas); } return 0; }
,,判断条件为四个点相减,除了对角的点不同其他的都相等
0 0
- HDU 5206 Four Inages Strategy
- Four Inages Strategy hdu 5206
- hdu 5206 Four Inages Strategy
- hdu 5206 Four Inages Strategy
- HDU 5206 Four Inages Strategy
- HDU 5206 BC Four Inages Strategy
- HDU 5206 Four Inages Strategy(几何题)
- hdu 5206 Four Inages Strategy【计算几何】【判断空间正方形】
- HDOJ 5206 Four Inages Strategy 暴力+几何
- Four Inages Strategy
- HDU5206-Four Inages Strategy
- 【HDU 5206】Four Inages Strategy —— 计算几何之空间正方形
- hdu 5206:Four Inages Strategy(判断四个点能否组成正方形)
- BestCoder Round 38-1001 Four Inages Strategy
- Four Inages Strateg
- HDU5206Four Inages Strategy
- HDU 5938 Four Operations
- hdu 5938 Four Operations
- 如何运行微商行业整合营销???
- SQL注入之SQLmap入门
- Java源码分析之Object
- VC控件大小和字体设置
- Latex中一些细节
- HDU 5206 Four Inages Strategy
- 深入理解计算机--字节顺序
- Android中Context
- LeetCode (11) Number of 1 Bits
- Four Inages Strategy hdu 5206
- Leapin' Lizards (hdu 2732 最大流)
- poj1001
- aidl学习
- C语言mmap()函数:建立内存映射