### 10425 - Mobile Destroyer

Posted:

**Sat Jan 18, 2003 6:40 am**why no work?

Code: Select all

`out`

Page **1** of **1**

Posted: **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.

You should check if the given coordinates are on the plane which the two spheres intersect.

Posted: **Sat Jan 18, 2003 10:45 am**

i don't get it

Posted: **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?

what this mean?

Posted: **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-

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

Posted: **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.

Posted: **Wed Jan 29, 2003 2:16 am**

I don't get this either..

Posted: **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;
}
```

Posted: **Fri Feb 21, 2003 8:20 am**

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

Posted: **Tue Oct 07, 2003 8:57 pm**

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

Posted: **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.

Posted: **Tue May 04, 2004 9:08 am**

Can someone explain this question? Thanks.. =)

Posted: **Sat May 28, 2005 12:52 am**

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).htl wrote:I think it means to check if the point is on the intersecting circle, not the plane where the circle is.

Posted: **Fri Jan 06, 2006 8:22 pm**

I managed to get AC with using doubles, one call to sqrt(), and EPS=1e-8.

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

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.If a stolen set is on the plane passing through the common points of the boundaries of the spheres of two AMDs

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