Code: Select all
out
Moderator: Board moderators
Code: Select all
out
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;
}
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.
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