ENG  RUS Timus Online Judge
Online Judge
Problems
Authors
Online contests
Site news
Webboard
Problem set
Submit solution
Judge status
Guide
Register
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

## Discussion of Problem 1433. Diamonds

#WA8
Posted by Berbinschi Tudor 15 Mar 2012 16:44
Strange. Can you give me some test data for my C++ program?
if ((sir[0]==sir1[1] && sir[1]==sir1[0] && sir[2]+sir[3]==sir1[2]+sir1[3]) ||
((sir[3]==sir1[1] && sir[2]==sir1[0]) && (sir[0]==sir1[2] && sir[1]==sir1[3])))
cout <<"equal";
else
{
if (sir[0]==sir1[2] && sir[1]==sir1[3] && sir[3]==sir1[1] && sir[2]==sir1[0] )
cout <<"equal";
else
{
if (sir[0]==sir1[1] && sir[1]==sir1[3] && sir[2]==sir1[2] && sir[3]==sir1[0])
cout <<"equal";
else
{
if (sir[0]==sir1[0] && sir[1]==sir1[1] && sir[2]==sir1[2] && sir[3]==sir1[3])
cout <<"equal";
else
{
if (sir[3]==sir1[0]&&sir[2]==sir1[1]&&sir[1]==sir1[2]&&sir[0]==sir1[3])
cout <<"equal";

else
cout <<"different";
}
}
}
}
My code seems legit. Tnx.
All tests posted on the Forum (Discuss work for my program)
Again working.

Edited by author 15.03.2012 17:12

Edited by author 15.03.2012 17:24
Re: #WA8
Posted by Morph 15 Mar 2012 16:47
GRBY
YGBR
should be equal.
Re: #WA8
Posted by Morph 15 Mar 2012 16:54
Here: sir[2]==sir1[3] && sir[3]==sir1[2]

YGBR
GBRY
should be different. :D
Re: #WA8
Posted by Morph 15 Mar 2012 17:07
sir[0]==sir1[1] && sir[1]==sir1[0]

RRRR
RRGG
your algorithm's output is equal. :)
Re: #WA8
Posted by Morph 15 Mar 2012 17:21
(sir[3]=sir1[0]&&sir[2]=sir1[1]&&sir[1]=sir1[2]&&sir[0]=sir1[3]) - is equal

Try it: RGBY
YBGR

I'm not sure it's right, but you can try. :)