unfinish
This commit is contained in:
parent
8d26ef13f2
commit
ca45976f26
27
luogu/p3717.py
Normal file
27
luogu/p3717.py
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# Unfinish
|
||||||
|
from typing import Tuple, List
|
||||||
|
import math
|
||||||
|
|
||||||
|
n, m, r = input().split(" ")
|
||||||
|
locations: List[Tuple[str, str]] = []
|
||||||
|
for i in range(int(m)):
|
||||||
|
location: Tuple[str, str] = tuple(input().split(" "))
|
||||||
|
locations.append(location)
|
||||||
|
|
||||||
|
map = [[0 for _ in range(int(n))] for _ in range(int(n))]
|
||||||
|
count = 0
|
||||||
|
|
||||||
|
for i in range(int(n)):
|
||||||
|
for j in range(int(n)):
|
||||||
|
if map[i][j] == 0:
|
||||||
|
for k in range(int(m)):
|
||||||
|
distance = math.sqrt(
|
||||||
|
(int(locations[k][0]) - i) ** 2 + (int(locations[k][1]) - j) ** 2
|
||||||
|
)
|
||||||
|
if distance <= float(r):
|
||||||
|
map[i][j] = 1
|
||||||
|
count = count + 1
|
||||||
|
break
|
||||||
|
|
||||||
|
print(count)
|
||||||
|
print(map)
|
Loading…
x
Reference in New Issue
Block a user