Page 1 of 2
11298 - Dissecting a Hexagon
Posted: Sun Sep 30, 2007 9:28 pm
by Lomir
Am i right?
If we can divede hexagon into k parallelograms. We can divide it into k+1 parallelograms by cuting any one parallelogram into 2 parallelograms for exapmle by middle.
According to the input we can't divide hexagon in 2 parallelograms, but we can divite into 3.
So:
if (n >= 3) answer is 1
else answer is 0
Re: 11298 Dissecting a Hexagon
Posted: Sun Sep 30, 2007 9:36 pm
by Robert Gerbicz
Lomir wrote:Am i right?
If we can divede hexagon into k parallelograms. We can divide it into k+1 parallelograms by cuting any one parallelogram into 2 parallelograms for exapmle by middle.
According to the input we can't divide hexagon in 2 parallelograms, but we can divite into 3.
So:
if (n >= 3) answer is 1
else answer is 0
Replace the word parallelogram by rhombus!
It is a very sad thing that they can't provide a contest without errors. I've sent a clarification email about 9 hours ago but there was no answer.
Posted: Sun Sep 30, 2007 11:06 pm
by baodog
It's much more general than just Rhombus.
The precise wording should be
Code: Select all
divide into n parallelograms of equal area.
Somehow my problem tester just assumed this as I did.
Sorry about this. Unfortunately, I did not get the password to post on the clarification board in time.
Posted: Sun Sep 30, 2007 11:25 pm
by luishhh
Are they parellelograms or rhombus? I honestly find your post confusing
EDIT: I got AC considering Parellelograms not neccesarily Rhombus, so forget the word Rhombus! Moreover there is a test case with n <= 0, could anybody explain me why there are such stupid cases?
Posted: Sun Sep 30, 2007 11:29 pm
by baodog
Both interpretations (although different).
lead you to the same output as the judge:
1) n Parallelogram, each with all sides equal.
2) n Parallelograms with equal area.
Posted: Sun Sep 30, 2007 11:41 pm
by Lomir
baodog wrote:Both interpretations (although different).
lead you to the same output as the judge:
1) n Parallelogram, each with all sides equal.
2) n Parallelograms with equal area.
According to the probmes statement i can find any parallelograms. Please fix it.
P.S. Solved different size rombus problem... Now will try once again to solve it...

Posted: Sun Sep 30, 2007 11:52 pm
by luishhh
1) n Parallelogram, each with all sides equal.
2) n Parallelograms with equal area.
I got AC using the second hypothesis. So, if both are equivalent in this problem, please tell me how to dissect a hexagon in 6 rhombus with all equal sides, I don't find the solution.
Posted: Mon Oct 01, 2007 6:13 am
by goodwill
AC now after using string to read input!!!
Posted: Mon Oct 01, 2007 6:18 am
by Robert Gerbicz
That's good, but remember that in this problem:
And remove your spoiler!
Posted: Mon Oct 01, 2007 7:30 am
by sclo
Is it possible to dissect if n is not a multiple of 3?
Posted: Mon Oct 01, 2007 12:02 pm
by goodwill
I read a paper and it said that :
For a n-gon (n>=5), there is no way to dissect it into m triangles with equal area with gcd(n,m)=1.
Posted: Mon Oct 01, 2007 4:33 pm
by WingletE
I can't think of any cases that n is not a multiple of 3 when the output is 1.
If it's really possible, could somebody give an example?
Posted: Mon Oct 01, 2007 4:52 pm
by jah
There is a test case
I don't know why but I finally got AC after taking care of this exception.
So the matter is that there is no way of dissecting an hexagon in 0 parallelograms ...
Posted: Mon Oct 01, 2007 6:08 pm
by tobby
This task is sooo stupid

There are some invalid characters other than spaces and digits, probably tabs. If you use PASCAL, you will need some special routines to parse the input (otherwise you get Runtime Error with no apparent reason). But if you use C or C++, you will not face any problem using scanf. This is pretty unfair.
Posted: Mon Oct 01, 2007 7:57 pm
by sclo
This problem should be fixed.
I get WA when I use cin to read input, but get AC when I use scanf
meaning there are illegal characters in the input.