题解 | 最大 FST 距离

最大 FST 距离

https://www.nowcoder.com/practice/6295f81acd1b4fb59c8beed92577f64b

n = int(input())
l = list(map(int, input().split()))
S1 = []
S2 = []
for i in range(1,len(l)+1):
    s1 = i**2 + l[i-1]**2
    s2 = i**2 - l[i-1]**2
    S1.append(s1)
    S2.append(s2)
m = max(max(S1) - min(S1),max(S2) - min(S2))
print(m)

全部评论

相关推荐

02-25 19:38
门头沟学院 Java
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务