Skip to content

Commit 27ef3cd

Browse files
committed
[BOJ] 어린 왕자 / 실버3 / 50분
https://www.acmicpc.net/problem/1004
1 parent ebef2f6 commit 27ef3cd

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
T = int(input())
2+
result = []
3+
4+
for _ in range(T):
5+
# 출발점 도착점
6+
x1, y1, x2, y2 = list(map(int, input().split()))
7+
# 행성계의 개수
8+
n = int(input())
9+
count = 0
10+
for _ in range(n):
11+
cx, cy, cr = map(int, input().split())
12+
dis1 = (x1 - cx) ** 2 + (y1 - cy) ** 2
13+
dis2 = (x2 - cx) ** 2 + (y2 - cy) ** 2
14+
pow_cr = cr ** 2
15+
16+
if pow_cr > dis1 and pow_cr > dis2:
17+
pass
18+
elif pow_cr > dis1:
19+
count += 1
20+
elif pow_cr > dis2:
21+
count += 1
22+
result.append(count)
23+
24+
for i in result:
25+
print(i, end="\n")

0 commit comments

Comments
 (0)