From ca45976f263080968b53f041a777d092a238e362 Mon Sep 17 00:00:00 2001 From: sangge <2251250136@qq.com> Date: Tue, 12 Mar 2024 15:07:09 +0800 Subject: [PATCH] unfinish --- luogu/p3717.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 luogu/p3717.py diff --git a/luogu/p3717.py b/luogu/p3717.py new file mode 100644 index 0000000..ff2823d --- /dev/null +++ b/luogu/p3717.py @@ -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) \ No newline at end of file