Page 1 of 1

11164 - Kingdom Division

Posted: Sun Jan 21, 2007 3:51 am
by joy
Anyone can give me some tricky testcases ?
I got WA....

here is my code:

Code: Select all

 Acc......
please help...

Posted: Sun Jan 21, 2007 9:27 am
by ferng1021
try these input:

Code: Select all

4 6 9
6 7 15

Posted: Sun Jan 21, 2007 2:00 pm
by joy
ferng1021 wrote:try these input:

Code: Select all

4 6 9
6 7 15
thanks for ur reply ......
but wiil be the output for this input... i got negetive output
is it: Poor King!

i have changed my code:

Code: Select all

 Acc....
some input and out put:

input:

Code: Select all

0 4 5
0 5 0
0 9 7
5 6 0
0 0 0
4 98 5
98 5 69
-1 34 3
output:

Code: Select all

Set 1:
0.0000
Set 2:
0.0000
Set 3:
0.0000
Set 4:
0.0000
Set 5:
Poor King!
Set 6:
0.4278
Set 7:
Poor King!

Posted: Mon Jan 22, 2007 4:03 pm
by paulmcvn
Could you give me an idea for this problem?

Posted: Tue Jan 23, 2007 7:41 am
by FAQ
Thanks a lot for joy's tests !!

To paulmcvn: try to split the polygon AFXE into 2 triangles, called x, y
Find the relationship between a, b, c, x, y. You will see the solution
And please remove your spoiler here http://online-judge.uva.es/board/viewtopic.php?t=14068

Posted: Thu Jan 25, 2007 6:25 am
by Vexorian
Hello there, I think I need help finding the bug in my version...

this is the i/o I got so far:

Code: Select all

1 2 1
2 4 2
1 3 3
0 4 5
0 5 0
0 9 7
5 6 0
0 0 0
4 98 5
98 5 69
4 6 9
6 7 15
2 1 99
8 2 0.01
0 5 0
1 1.1 1
1 1.01 1
1 1.001 1
1 1.000001 1
-1 0 0

Code: Select all

Case 1:
2.0000
Case 2:
4.0000
Case 3:
5.0000
Case 4:
0.0000
Case 5:
0.0000
Case 6:
0.0000
Case 7:
0.0000
Case 8:
Poor King!
Case 9:
0.4278
Case 10:
Poor King!
Case 11:
Poor King!
Case 12:
Poor King!
Case 13:
Poor King!
Case 14:
0.2451
Case 15:
0.0000
Case 16:
20.0000
Case 17:
200.0000
Case 18:
2000.0000
Case 19:
2000000.0006
Edit: just noticed it is Set and not Case, testing again.
Edit II: Yeah, when you replace Case with Set it gets AC, this is kind of a shame for me..., anyways leaving the big I/O in case some needs it.


Ignore the last one, it is wrong. It is good to see the input for this problem doesn't involve precision issues.

Posted: Thu Jan 25, 2007 2:27 pm
by Jan
You should remove the last case. I set the judge data such that no nasty precision error occurs. Because solving problem is more fascinating than correcting precision problems. :D