11455 - Behold my quadrangle
Moderator: Board moderators
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.
Re: 11455 - WA need more test case
can u just mail me ur code plz??
Re: 11455 - Behold My Quadrangle
Input
Output
Code: Select all
3
1 2 3 6
1 3 3 7
1 2 3 7
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
Are you dreaming right now?
http://www.dreamviews.com
Re: 11455 - Behold My Quadrangle
can anyone explain how to determine quadrangle and banana
Re: 11455 - Behold My Quadrangle
A 'quadrangle' is a valid quadrilateral whereas a 'banana' isn't!Iffat wrote:can anyone explain how to determine quadrangle and banana
-
- New poster
- Posts: 9
- Joined: Thu Aug 21, 2008 3:08 am
- Location: IUT
Re: 11455 - Behold My Quadrangle
can anyone explain me why 1 2 3 6 and 1 3 3 7 is not bananaandmej wrote:InputOutputCode: Select all
3 1 2 3 6 1 3 3 7 1 2 3 7
Code: Select all
quadrangle quadrangle banana
is it possible to make ne quadrangle when sum of its 3 side is equal to other side?
wanna be notorious....
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!
And Beware of the fact that the lengths are not in sorted order!
Re: 11455 - Behold My Quadrangle
Very cool.
Just sort the values and then the checking,
1st square
2nd rectangle
3rd quadrangle
finally banana

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.
This may be the address of success.
-
- Experienced poster
- Posts: 136
- Joined: Sat Nov 29, 2008 8:01 am
- Location: narayangong,bangladesh.
- Contact:
beware???-11455 - Behold My Quadrangle
BEWARE!!!!!!!!!!!!!1
INPUT MAY CONTAIN 0;
ALTHOUGH PROBLEM STATEMENT SAYS
INPUT MAY CONTAIN 0;
ALTHOUGH PROBLEM STATEMENT SAYS
I WASTE AT LEAST 10 SUBMISSION FOR THIS REASON.For each test case, there is a line with four positive integer numbers
Life is more complicated than algorithm.
http://felix-halim.net/uva/hunting.php?id=32359
For Hints: http://salimsazzad.wordpress.com
http://felix-halim.net/uva/hunting.php?id=32359
For Hints: http://salimsazzad.wordpress.com
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.
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.
Re: 11455 - Behold My Quadrangle
It isn't!!!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!
How to make a quadrangle when the sum of 3 sides is equal to the other side????????? It's a line!!! not a poligon!
Re: 11455 - Behold My Quadrangle
We called this a "degenerated" quadrangle, having zero area.x140l31 wrote:It isn't!!!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!
How to make a quadrangle when the sum of 3 sides is equal to the other side????????? It's a line!!! not a poligon!
Whether it is considered as a valid quadrangle depends on the problem setter/description...
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
please explain.
so how it will be quadrangle
10 8 7 6
please explain.
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 ;
}