HDU 5655 CA Loves Stick

Source: Internet
Author: User

CA Loves Stick

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


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 containsT Denoting the number of testcases.
T Testcases follow. Each testcase contains four integersa,b,c,D In a line, denoting the length of sticks.
1≤T≤1000, 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

Sourcebestcoder Round #78 (Div.2)

Recommendwange2014 | We have carefully selected several similar problems for you:5659 5658 5657 5654 5653 hit BC when the first problem encountered, originally very simple a problem, the data range a bit pit, the wrong three Times, the pit of the baby is dead. Quadrilateral rule: After three sides must be greater than the four sides. Test instructions: give you the length of four sides, determine whether it is a quadrilateral, yes, not No. Pay attention to the range of data!!! Attached code:
1#include <iostream>2#include <cstdio>3#include <cstring>4#include <algorithm>5 using namespacestd;6 intMain ()7 {8__int64 a[5],m;9     intt,i,j;Tenscanf"%d",&T); One      while(t--) A     { -          for(i=0; i<4; i++) -scanf"%i64d",&a[i]); theSort (a,a+4); -         if(a[0]==0) -         { -printf"no\n"); +             Continue; -         } +m=a[3]-a[1]-a[2]; A         if(m>=a[0]) atprintf"no\n"); -         Else -printf"yes\n"); -     } -     return 0; -}

HDU 5655 CA Loves Stick

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.