题解 | #搬圆桌#

搬圆桌

https://www.nowcoder.com/practice/81bb01ef2bb144808a8277e9164a0886

import math

while True:
    try:
        r, x, y, x1, y1 = map(int, input().split())

        distance = math.sqrt((x - x1) ** 2 + (y - y1) ** 2)

        cnt = math.ceil(distance / (2 * r))  # 直接计算需要的步数,使用向上取整

        print(cnt)
    except:
        break

全部评论

相关推荐

Dream_coding:你是不是只投大厂了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务