10250 - The Other Two Trees

All about problems in Volume 102. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
Observer
Guru
Posts: 570
Joined: Sat May 10, 2003 4:20 am
Location: Hong Kong

10250 - The Other Two Trees

Post by Observer »

I thought this prob is easy, but......

Could anyone tell me when the line "Impossible." would be printed (or never?), and also give me some test cases?? Thx in advance!!
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org
Observer
Guru
Posts: 570
Joined: Sat May 10, 2003 4:20 am
Location: Hong Kong

Post by Observer »

Hmm... I get Accepted by changing just one thing: from double to extended! Oh 2+ hours wasted... :(
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org
yiuyuho
A great helper
Posts: 325
Joined: Thu Feb 21, 2002 2:00 am
Location: United States
Contact:

Post by yiuyuho »

For my program, I put impossible when the 2 points are the same.

I got AC as well.....

I used some intuitive method - basically, assume the 2 square is axis aligned, and of maximum size, then find the other 2 points. I hope there is a more mathematical approach to it?

Plus, may be the judge data is plain weak :-p, so I really want some technique that couples with some degree of proof.

Any one care to shine some light?
free
New poster
Posts: 6
Joined: Fri Aug 13, 2010 8:35 am
Location: China

10250 The Other Two Trees,ask for help.

Post by free »

for this problem,i have thought for a whole night,maybe i got the ideal, but i still cannot wrte out the code.

that is i cannot express my ideal with code, could somebody tell me the core code?

thanks in advance.
yatsen
Learning poster
Posts: 68
Joined: Fri Nov 23, 2001 2:00 am
Location: taiwan

Re: 10250 - The Other Two Trees

Post by yatsen »

Can anyone who got AC post some sample I/O?
I always got WA. :(
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10250 - The Other Two Trees

Post by brianfry713 »

I got AC without ever printing impossible. I used C's long double.

Input:

Code: Select all

10 0 -10 0
10 0 -10 0
10 0 -10 0
1.4 2.3 53.2 -1.0
1.1 4.2 10.4 -1002.4
4  1 66 2
-1342 .1 -2.4 2.5
Output:

Code: Select all

0.0000000000 -10.0000000000 0.0000000000 10.0000000000
0.0000000000 -10.0000000000 0.0000000000 10.0000000000
0.0000000000 -10.0000000000 0.0000000000 10.0000000000
28.9500000000 26.5500000000 25.6500000000 -25.2500000000
509.0500000000 -494.4500000000 -497.5500000000 -503.7500000000
34.5000000000 32.5000000000 35.5000000000 -29.5000000000
-673.4000000000 671.1000000000 -671.0000000000 -668.5000000000
Check input and AC output for thousands of problems on uDebug!
lighted
Guru
Posts: 587
Joined: Wed Jun 11, 2014 9:56 pm
Location: Kyrgyzstan, Bishkek

Re: 10250 - The Other Two Trees

Post by lighted »

brianfry713 wrote:I got AC without ever printing impossible. I used C's long double.
Yes, it is always possible to find trees. To get accepted double is enough. :)
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman
Post Reply

Return to “Volume 102 (10200-10299)”