后端T1O(n^2)枚举即可 void solve(int u) { cin>>n; for(int i=1;i<=n;i++)cin>>w[i]; ll res=0; for(int i=1;i<=n;i++){ for(int j=i+1;j<=n;j++){ int dist=min(j-i,i-j+n); res=max(res,1ll*dist*(w[i]+w[j])); } } cout<<res<...