11455 - Behold my quadrangle

All about problems in Volume 114. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

User avatar
nahid
New poster
Posts: 18
Joined: Wed Oct 04, 2006 8:59 pm
Location: DHAKA,BANGLADESH
Contact:

11455 - Behold my quadrangle

Post by nahid » Thu May 22, 2008 12:48 am

i'm getting right output for all smple input. but having WA in submission. if i had more crtical input, then it would easy to fix my bug. pls give me some critical inputs. if u need to cheak my code, i'll post it.

Rushow
New poster
Posts: 14
Joined: Sat Oct 14, 2006 4:09 pm
Location: Dhaka,Bangladesh

Re: 11455 - WA need more test case

Post by Rushow » Thu May 22, 2008 8:08 am

can u just mail me ur code plz??

User avatar
andmej
Experienced poster
Posts: 158
Joined: Sun Feb 04, 2007 7:45 pm
Location: Medellin, Colombia

Re: 11455 - Behold My Quadrangle

Post by andmej » Thu May 22, 2008 4:51 pm

Input

Code: Select all

3
1 2 3 6
1 3 3 7
1 2 3 7
Output

Code: Select all

quadrangle
quadrangle
banana
Runtime errors in Pascal are reported as Wrong Answers by the online judge. Be careful.

Are you dreaming right now?
http://www.dreamviews.com

Iffat
New poster
Posts: 25
Joined: Sat Jul 22, 2006 9:47 am

Re: 11455 - Behold My Quadrangle

Post by Iffat » Tue Aug 05, 2008 12:57 pm

can anyone explain how to determine quadrangle and banana

User avatar
sohel
Guru
Posts: 856
Joined: Thu Jan 30, 2003 5:50 am
Location: New York

Re: 11455 - Behold My Quadrangle

Post by sohel » Wed Aug 06, 2008 1:53 pm

Iffat wrote:can anyone explain how to determine quadrangle and banana
A 'quadrangle' is a valid quadrilateral whereas a 'banana' isn't!

bleedingeyes
New poster
Posts: 9
Joined: Thu Aug 21, 2008 3:08 am
Location: IUT

Re: 11455 - Behold My Quadrangle

Post by bleedingeyes » Tue Sep 09, 2008 9:04 am

andmej wrote:Input

Code: Select all

3
1 2 3 6
1 3 3 7
1 2 3 7
Output

Code: Select all

quadrangle
quadrangle
banana
can anyone explain me why 1 2 3 6 and 1 3 3 7 is not banana
is it possible to make ne quadrangle when sum of its 3 side is equal to other side?
wanna be notorious....

Enzam
New poster
Posts: 2
Joined: Wed Nov 05, 2008 5:39 pm

Re: 11455 - Behold My Quadrangle

Post by Enzam » Wed Nov 05, 2008 5:43 pm

It is possible to make an quadrangle when sum of its 3 side is equal to other side.

And Beware of the fact that the lengths are not in sorted order!

Obaida
A great helper
Posts: 380
Joined: Wed Jan 16, 2008 6:51 am
Location: (BUBT) Dhaka,Bagladesh.

Re: 11455 - Behold My Quadrangle

Post by Obaida » Sat Dec 20, 2008 4:09 pm

Very cool. :wink:
Just sort the values and then the checking,
1st square
2nd rectangle
3rd quadrangle
finally banana
try_try_try_try_&&&_try@try.com
This may be the address of success.

sazzadcsedu
Experienced poster
Posts: 136
Joined: Sat Nov 29, 2008 8:01 am
Location: narayangong,bangladesh.
Contact:

beware???-11455 - Behold My Quadrangle

Post by sazzadcsedu » Fri Feb 20, 2009 9:59 pm

BEWARE!!!!!!!!!!!!!1

INPUT MAY CONTAIN 0;
ALTHOUGH PROBLEM STATEMENT SAYS
For each test case, there is a line with four positive integer numbers
I WASTE AT LEAST 10 SUBMISSION FOR THIS REASON.
Life is more complicated than algorithm.
http://felix-halim.net/uva/hunting.php?id=32359
For Hints: http://salimsazzad.wordpress.com

allenlam
New poster
Posts: 8
Joined: Tue Jun 09, 2009 6:46 am

Re: 11455 - Behold My Quadrangle

Post by allenlam » Tue Jun 30, 2009 6:06 am

After a few times of runtime error, I think the testing data of this problem is badly formatted, and the description is badly written.

Don't trust the description and the sample input format.

When it says the first line contains something it can mean the first line is blank.
When it says there is a line containing 4 integers it can mean the integers are written on several lines.
As a standard, you have to expect extra spaces and CR anywhere.

Finally got it Accepted with brute force parsing the input. It is not a friendly problem for Java programmers.

x140l31
Learning poster
Posts: 69
Joined: Tue Jan 30, 2007 12:51 am

Re: 11455 - Behold My Quadrangle

Post by x140l31 » Wed Jul 15, 2009 1:31 am

Enzam wrote:It is possible to make an quadrangle when sum of its 3 side is equal to other side.

And Beware of the fact that the lengths are not in sorted order!
It isn't!!!

How to make a quadrangle when the sum of 3 sides is equal to the other side????????? It's a line!!! not a poligon!

phy
New poster
Posts: 3
Joined: Sat Apr 26, 2008 8:41 am

Re: 11455 - Behold My Quadrangle

Post by phy » Tue Aug 11, 2009 3:22 am

x140l31 wrote:
Enzam wrote:It is possible to make an quadrangle when sum of its 3 side is equal to other side.

And Beware of the fact that the lengths are not in sorted order!
It isn't!!!

How to make a quadrangle when the sum of 3 sides is equal to the other side????????? It's a line!!! not a poligon!
We called this a "degenerated" quadrangle, having zero area.
Whether it is considered as a valid quadrangle depends on the problem setter/description...

sms.islam
New poster
Posts: 19
Joined: Sat Oct 10, 2009 10:28 am

Re: 11455 - Behold My Quadrangle

Post by sms.islam » Thu Nov 12, 2009 9:13 am

"It is possible to make an quadrangle when sum of its 3 side is equal to other side. when it is sorted"

so how it will be quadrangle

10 8 7 6

please explain.

dewsworld
New poster
Posts: 12
Joined: Fri Aug 13, 2010 11:52 am

Re: 11455 - Behold My Quadrangle

Post by dewsworld » Sat Nov 27, 2010 9:23 pm

Any idea why I've got WA on this

Code: Select all

#include <iostream>
#include <cstdio>
using namespace std ;

int main()
{
//    freopen("in.txt", "r", stdin ) ;

    int a,b,c,d ;
    int noTest ;
    int max ;

    cin >> noTest ;

    while( noTest-- )
    {
        cin >> a >> b >> c >> d ;

        max = a ;
        if( max < b )   max = b ;
        if( max < c )   max = c ;
        if( max < d )   max = d ;

        if( a+b+c+d<2*max )                     cout << "banana" << endl ;
        else if( a==b && b==c && c==d )         cout << "square" << endl ;
        else if( a==c && b==d && a!=b && c!=d ) cout << "rectangle" << endl ;
        else                                    cout << "quadrangle" << endl ;
    }

    return 0 ;
}

shuvokr
Learning poster
Posts: 66
Joined: Tue Oct 02, 2012 8:16 pm
Location: Bangladesh

Re: 11455 - Behold My Quadrangle

Post by shuvokr » Mon Feb 18, 2013 8:31 pm

use unsigned long long int

Code: Select all

enjoying life ..... 

Post Reply

Return to “Volume 114 (11400-11499)”