Dartboard Score
Imagine a dartboard with three circles around the center. The function score receives the hit coordinates x and y and returns the number of points for that position. A hit within radius 1 gives 10 points, within radius 5 gives 5, within radius 10 gives 1, and anything outside the target gives 0.
Примеры
Ввод
(0, 0)Вывод
10Ввод
(-0.1, -0.1)Вывод
10Ввод
(0, 5)Вывод
5Нужно реализовать
def score(x: float, y: float) -> int:
Теги
math
Συνδεθείτε για να δείτε το ιστορικό υποβολών
ΣύνδεσηΣυνδεθείτε για να χρησιμοποιήσετε τον AI Mentor
ΣύνδεσηVisible tests
1
Input
0, 0Expected
102
Input
-0.1, -0.1Expected
103
Input
0, 5Expected
54
Input
-5, 0Expected
55
Input
0, 10Expected
16
Input
10, 10Expected
0Focus radio
Paused · SomaFM · Fluid