求助,数据点1 RE,不知道错哪了,Python
  • 板块P4995 跳跳!
  • 楼主yghygh123
  • 当前回复1
  • 已保存回复1
  • 发布时间2022/4/3 21:40
  • 上次更新2023/10/28 04:42:12
查看原帖
求助,数据点1 RE,不知道错哪了,Python
595980
yghygh123楼主2022/4/3 21:40

数据点1求一下```python n=int(input()) l=[] l=list(map(int,input().split())) l.append(0) l.sort() tou=0 wei=-1 ans=0 if len(l)==2: print(max(l)**2) else: while l[tou]!=l[wei]: ans+=(l[tou]-l[wei])**2 tou+=1 ans += (l[tou] - l[wei]) ** 2 wei-=1 print(ans)

2022/4/3 21:40
加载中...