## 11455 - Behold my quadrangle

Moderator: Board moderators

nahid
New poster
Posts: 18
Joined: Wed Oct 04, 2006 8:59 pm
Contact:

### 11455 - Behold my quadrangle

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

### Re: 11455 - WA need more test case

can u just mail me ur code plz??

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

### Re: 11455 - Behold My Quadrangle

Input

Code: Select all

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

Code: Select all

``````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

can anyone explain how to determine quadrangle and banana

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

### Re: 11455 - Behold My Quadrangle

Iffat wrote:can anyone explain how to determine quadrangle and banana

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

### Re: 11455 - Behold My Quadrangle

andmej wrote:Input

Code: Select all

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

Code: Select all

``````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

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

### Re: 11455 - Behold My Quadrangle

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

Experienced poster
Posts: 136
Joined: Sat Nov 29, 2008 8:01 am
Contact:

### beware???-11455 - Behold My Quadrangle

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

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

### Re: 11455 - Behold My Quadrangle

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

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

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

"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

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

### Re: 11455 - Behold My Quadrangle

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

### Re: 11455 - Behold My Quadrangle

use unsigned long long int

Code: Select all

``enjoying life ..... ``