2020牛客暑期多校训练营(第四场)F

Ancient Distance

https://ac.nowcoder.com/acm/contest/5669/A

题目描述

  ZYB has a so-called smart brain. He can always point out the key-point in a complex problem.
  There are two parallel lines and in a plane. are all distinct points.
  You only know the Euclidean Distances between . But you don't know the exact order of points (i.e. You don't know whether it's or ).
  Could you determine the order of points quickly, like the ZYB does?

输入描述

  The input contains multiple cases. The first line of the input contains a single integer , the number of cases.
  For each case, there are four integers in a line, indicating the distances between .
  It is guaranteed that each case corresponds to a valid solution.

输出描述

  For each case, output AB//CD (Quotation marks) if , or output AB//DC (Quotation marks) if .

示例1

输入

2  
3 5 5 3
5 3 3 5

输出

AB//CD
AB//DC

分析

  由三角形三边关系,,故
3.png
  当 ,有
1.png
  当 ,有
2.png
  找到了完全相反的两个结论,可以作为判断的依据。

代码

/******************************************************************
Copyright: 11D_Beyonder All Rights Reserved
Author: 11D_Beyonder
Problem ID: 2020牛客暑期多校训练营(第四场) Problem F
Date: 8/15/2020
Description: Computational Geometry
*******************************************************************/
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
    int _;
    for(cin>>_;_;_--){
        int AC,AD,BC,BD;
        scanf("%d%d%d%d",&AC,&AD,&BC,&BD);
        puts(AD+BC>AC+BD?"AB//CD":"AB//DC");
    }
    return 0;
}
牛客暑期多校训练营题解 文章被收录于专栏

收集牛客暑期多校训练营的题解

全部评论

相关推荐

Hello_WordN:咱就是说,除了生命其他都是小事,希望面试官平安,希望各位平时也多注意安全
点赞 评论 收藏
分享
在评审的大师兄很完美:像这种一般就是部门不匹配 转移至其他部门然后挂掉 我就是这样被挂了
点赞 评论 收藏
分享
1 收藏 评论
分享
牛客网
牛客企业服务