10425 - Mobile Destroyer

All about problems in Volume 104. 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
abc
New poster
Posts: 15
Joined: Sun Dec 15, 2002 2:51 pm

10425 - Mobile Destroyer

Post by abc » Sat Jan 18, 2003 6:40 am

why no work? :cry: :roll:

Code: Select all

out
Last edited by abc on Mon Feb 17, 2003 4:35 pm, edited 1 time in total.

LittleJohn
Learning poster
Posts: 83
Joined: Wed Feb 27, 2002 2:00 am
Location: Taiwan

Post by LittleJohn » Sat Jan 18, 2003 8:41 am

It is said that "If a stolen set is on the plane passing through the common points of the boundaries of the spheres of two AMDs, no AMD takes any action at all!"
You should check if the given coordinates are on the plane which the two spheres intersect.

abc
New poster
Posts: 15
Joined: Sun Dec 15, 2002 2:51 pm

Post by abc » Sat Jan 18, 2003 10:45 am

i don't get it

abc
New poster
Posts: 15
Joined: Sun Dec 15, 2002 2:51 pm

Post by abc » Mon Jan 20, 2003 4:22 am

a stolen set is on the plane passing through the common points of the boundaries of the spheres of two AMDs

what this mean?

turuthok
Experienced poster
Posts: 193
Joined: Thu Sep 19, 2002 6:39 am
Location: Indonesia
Contact:

Post by turuthok » Tue Jan 21, 2003 1:00 pm

I have not solved this problem but I would interpret it this way:

"the plane passing thru the common points of the boundaries of the spheres" might be "the circle that forms the intersection of both spheres".

Please confirm,

-turuthok-

htl
Experienced poster
Posts: 185
Joined: Fri Jun 28, 2002 12:05 pm
Location: Taipei, Taiwan

Post by htl » Mon Jan 27, 2003 5:09 am

I think it means to check if the point is on the intersecting circle, not the plane where the circle is.

Larry
Guru
Posts: 647
Joined: Wed Jun 26, 2002 10:12 pm
Location: Hong Kong and New York City
Contact:

Post by Larry » Wed Jan 29, 2003 2:16 am

I don't get this either..

abc
New poster
Posts: 15
Joined: Sun Dec 15, 2002 2:51 pm

Post by abc » Mon Feb 17, 2003 4:36 pm

So why this not work?

Code: Select all

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <assert.h>

int main(){
  char name[7];
  long long x, y, z;
  long long x1, y1, z1, r1;
  long long x2, y2, z2, r2;
  char a, b, c;

  while ( 12 == scanf("%s %llu %llu %llu %llu %llu %llu %llu %llu %llu %llu %llu", name, &x1, &y1, &z1, &r1, &x2, &y2, &z2, &r2, &x\
, &y, &z ) ) {
    assert( r1 >= 0 && r2 >= 0 );

    a = ( ( ( x1 - x ) * ( x1 - x ) ) + ( ( y1 - y ) * ( y1 - y ) ) + ( ( z1 - z ) * ( z1 - z ) ) ) <= ( r1 * r1 );
    b = ( ( ( x2 - x ) * ( x2 - x ) ) + ( ( y2 - y ) * ( y2 - y ) ) + ( ( z2 - z ) * ( z2 - z ) ) ) <= ( r2 * r2 );
    c = a || b;
    if ( ( a && b ) && ( ( ( ( x1 - x ) * ( x1 - x ) ) + ( ( y1 - y ) * ( y1 - y ) ) + ( ( z1 - z ) * ( z1 - z ) ) ) != ( r1 * r1 )\
 && ( ( ( x2 - x ) * ( x2 - x ) ) + ( ( y2 - y ) * ( y2 - y ) ) + ( ( z2 - z ) * ( z2 - z ) ) ) != ( r2 * r2 ) ) ) c = 0;
    printf("%s\n%c\n%c\n%c\n", name, ( a ) ? 'y' : 'n', ( b ) ? 'y' : 'n', ( c ) ? 'y' : 'n' );
  }

  return 0;
}

anupam
A great helper
Posts: 405
Joined: Wed Aug 28, 2002 6:45 pm
Contact:

please help

Post by anupam » Fri Feb 21, 2003 8:20 am

i also face the same probem..
the line is not clear for me to understand..
i have coded the same coding like the preveous and got wa for a several times.
will any1 that got ac help??
:oops: :oops:
"Everything should be made simple, but not always simpler"

Larry
Guru
Posts: 647
Joined: Wed Jun 26, 2002 10:12 pm
Location: Hong Kong and New York City
Contact:

Post by Larry » Tue Oct 07, 2003 8:57 pm

Can someone post some input? I also have trouble with this..

Subeen
Experienced poster
Posts: 127
Joined: Tue Nov 06, 2001 2:00 am
Location: Bangladesh
Contact:

Post by Subeen » Tue Jan 27, 2004 8:48 am

I am also getting WA. and now confused about the problem statement. :-? Is there any special trick in this problem? plz post some inputs/ouputs.

Larry
Guru
Posts: 647
Joined: Wed Jun 26, 2002 10:12 pm
Location: Hong Kong and New York City
Contact:

Post by Larry » Tue May 04, 2004 9:08 am

Can someone explain this question? Thanks.. =)

minskcity
Experienced poster
Posts: 199
Joined: Tue May 14, 2002 10:23 am
Location: Vancouver

Post by minskcity » Sat May 28, 2005 12:52 am

htl wrote:I think it means to check if the point is on the intersecting circle, not the plane where the circle is.
That's wrong - they are asking about the plane, circle would be too easy. There are no tricky test cases that I know of, I got AC when I switched from long double to long long (after getting 7 WA's).

daveon
Experienced poster
Posts: 229
Joined: Tue Aug 31, 2004 2:41 am
Location: TORONTO, CANADA

Post by daveon » Fri Jan 06, 2006 8:22 pm

I managed to get AC with using doubles, one call to sqrt(), and EPS=1e-8.
If a stolen set is on the plane passing through the common points of the boundaries of the spheres of two AMDs
means that if the stolen set is on the plane containing the circle or point (resulting fron the intersection of two spheres), then the set is not made useless.

No need for vectors. Just use distance formula and heron's formula for triangle.

Post Reply

Return to “Volume 104 (10400-10499)”