20250920 baekjoon
This commit is contained in:
parent
51d4b229f5
commit
bad5f66373
23
code_study/Baekjoon/python/1004.py
Normal file
23
code_study/Baekjoon/python/1004.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import sys
|
||||||
|
|
||||||
|
input = sys.stdin.readline
|
||||||
|
|
||||||
|
def pow_dist(x1, y1, x2, y2) :
|
||||||
|
return (x1-x2)**2 + (y1-y2)**2
|
||||||
|
|
||||||
|
for _ in range(int(input())) :
|
||||||
|
x1, y1, x2, y2 = map(int, input().split())
|
||||||
|
|
||||||
|
count = 0
|
||||||
|
for _ in range(int(input())) :
|
||||||
|
cx, cy, cr = map(int, input().split())
|
||||||
|
dist1 = pow_dist(x1,y1,cx,cy)
|
||||||
|
dist2 = pow_dist(x2,y2,cx,cy)
|
||||||
|
pow_cr = cr**2
|
||||||
|
|
||||||
|
if pow_cr > dist1 and pow_cr > dist2 :
|
||||||
|
pass
|
||||||
|
elif pow_cr > dist1 or pow_cr > dist2 :
|
||||||
|
count += 1
|
||||||
|
|
||||||
|
print(count)
|
||||||
Loading…
x
Reference in New Issue
Block a user