T = sc.nextInt();
int[] scores = {6,13,13,4,4,18,18,1,1,20,20,5,5,12,12,9,9,14,14,11,11,8,8,16,16,7,7,19,19,3,3,17,17,2,2,15,15,10,10,6};
for(test_case = 1; test_case <= T; test_case++) {
// 이 부분에서 알고리즘 프로그램을 작성하십시오.
int bullRadius = sc.nextInt();
int tpInner = sc.nextInt();
int tpOuter = sc.nextInt();
int dbInner = sc.nextInt();
int dbOuter = sc.nextInt();
int shots = sc.nextInt();
int sum = 0;
for (int i = 0; i < shots; i ++) {
int score = 1;
int x = sc.nextInt();
int y = sc.nextInt();
double deg, r;
if (x == 0) {
if (y > 0) deg = 90;
else deg = 270;
}
else if (y == 0) {
if (x > 0) deg = 0;
else deg = 180;
}
else
deg = Math.atan((float)y / x) / Math.PI * 180;
r = Math.sqrt(x * x + y * y);
if (deg < 0) deg += 360;
if (r < bullRadius) {
sum += 50;
continue;
}
if (r > dbOuter) {
continue;
}
if (dbInner < r && dbOuter > r) score = 2;
else if (tpInner < r && tpOuter > r) score = 3;
int scoreIdx = (int)(deg / 9);
score = score * scores[scoreIdx];
sum += score;
}
System.out.println("Case #" + test_case);
System.out.println(sum);
}
}
왜죠
2점 3점 을 넣는게 아니라 그 다트판에 쪼개진 점수 *2 *3이 되는거임
경계선이라 36개로 점수 나눈건 알겠는데 왜 deg를 9로 나눈거져 ㅠㅠ