답안 #3782

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
3782 2013-08-31T08:18:38 Z pl0892029 Lonely mdic (kriii1_L) C++
0 / 1
52 ms 1108 KB
#include <cstdio>
#include <algorithm>
#include <cmath>

#define PI 3.1415926

using namespace std;

typedef struct circle {
 int x,y,r;
}circle;

bool cmp(circle A,circle B) {
 return A.r > B.r;
}

double dist(int x,int y,double dx,double dy) {
 return sqrt((dx-x)*(dx-x)+(dy-y)*(dy-y));
}

circle arr[500];
bool isNeeded[500];

int main() {
 int n;
 scanf("%d",&n);

 for(int i=0;i<n;i++)
  scanf("%d %d %d",&arr[i].x,&arr[i].y,&arr[i].r);
 
 sort(arr,arr+n,cmp);

 for(int i=0;i<n;i++) {
  bool check = true;
  for(int j=0;j<3600;j++) {
   double x = arr[i].x+arr[i].r*sin(PI*j/1800);
   double y = arr[i].y+arr[i].r*cos(PI*j/1800);

   bool isIncluded = false;
   for(int k=0;k<i;k++) {
    if( !isNeeded[k] ) continue;
    if( arr[k].r > dist(arr[k].x,arr[k].y,x,y) ) {
     isIncluded = true;
     break;
    }
   }
   if( !isIncluded ) {
    check = false;
    break;
   }
  }
  if( !check )
   isNeeded[i] = true;
 }
 int count = 0;
 for(int i=0;i<n;i++)
  if( isNeeded[i] == false )
   count++;

 printf("%d",count);
}

# 결과 실행 시간 메모리 Grader output
1 Incorrect 52 ms 1108 KB Output isn't correct
2 Halted 0 ms 0 KB -