## 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

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

### 10425 - Mobile Destroyer

why no work?

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
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
i don't get it

abc
New poster
Posts: 15
Joined: Sun Dec 15, 2002 2:51 pm
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:
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".

-turuthok-

htl
Experienced poster
Posts: 185
Joined: Fri Jun 28, 2002 12:05 pm
Location: Taipei, Taiwan
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:
I don't get this either..

abc
New poster
Posts: 15
Joined: Sun Dec 15, 2002 2:51 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:

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??
"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:
Can someone post some input? I also have trouble with this..

Subeen
Experienced poster
Posts: 127
Joined: Tue Nov 06, 2001 2:00 am
Contact:
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:
Can someone explain this question? Thanks.. =)

minskcity
Experienced poster
Posts: 199
Joined: Tue May 14, 2002 10:23 am
Location: Vancouver
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