You are viewing a single comment's thread. Return to all comments →
Python. Small Code.....
n=int(input()) x=[int(i) for i in input().split()] s=sum(x) p=0 for i in range(n):p+= (i+1)*x[i] ma=p for i in range(n-1,-1,-1): p+=s-n*x[i] ma=max(p,ma) print(ma)
Seems like cookies are disabled on this browser, please enable them to open this website
Game Of Rotation
You are viewing a single comment's thread. Return to all comments →
Python. Small Code.....