HDU 56,554 Edge Shape judgment

Source: Internet
Author: User

CA Loves Stick

Time limit:2000/1000 MS (java/others) Memory limit:262144/262144 K (java/others)
Total submission (s): 563 Accepted Submission (s): 202


Problem Descriptionca loves to play with sticks.
One day he receives four pieces of sticks, he wants to know these sticks can spell a quadrilateral.
(What is quadrilateral?) Click here:https://en.wikipedia.org/wiki/quadrilateral)

Inputfirst Line containsTDenoting the number of testcases.
TTestcases follow. Each testcase contains four integersa,b,c,D In a line, denoting the length of sticks.
1≤T≤ 0≤a,b,c,D≤ 2-1

Outputfor each testcase, if these sticks can spell a quadrilateral, output "Yes"; Otherwise, output "No" (without the quotation marks).

Sample Input21 1 1 11 1 9 2

Sample Outputyesno

Source bestcoder Round #78 (Div.2) test instructions: Input four-sided long a,b,c,d to determine whether to form a quadrilateral: 1. Depending on the length of the edge, 0 2 is considered. Quadrilateral judging condition: the maximum edge is less than the sum of the other three sides in ascending order 3. According to the range of the edge length: a[0]>a[3]-a[2]-a[1] (addition processing will explode the data range should be removed by the subtraction process)
1#include <iostream>2#include <cstring>3#include <cstdio>4#include <map>5#include <queue>6#include <stack>7#include <algorithm>8 #definell __int649 #defineMoD 1Ten #definePI ACOs (-1.0) One using namespacestd; All a[5]; - intT; - intMain () the {  -scanf"%d",&t); -       for(intI=1; i<=t;i++) - { +scanf"%i64d%i64d%i64d%i64d", &a[0],&a[1],&a[2],&a[3]); -Sort (a,a+4); +     //cout<<a[0]<<a[1]<<a[2]<<a[3]<<endl; A     if(a[0]==0|| a[1]==0|| a[2]==0|| a[3]==0) atcout<<"No"<<Endl; -     Else -     { -     if(a[0]>a[3]-a[2]-a[1]) -cout<<"Yes"<<Endl; -      Else incout<<"No"<<Endl; -     } to } +     return 0; -}

HDU 56,554 Edge Shape judgment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.