結果
| 問題 | 
                            No.1096 Range Sums
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-06-27 20:13:43 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 153 ms / 2,000 ms | 
| コード長 | 184 bytes | 
| コンパイル時間 | 349 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 23,080 KB | 
| 最終ジャッジ日時 | 2024-07-05 20:43:43 | 
| 合計ジャッジ時間 | 2,174 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 12 | 
ソースコード
n = int(input())
a = [int(i) for i in input().split()]
ans = 0
for i in range(n//2):
    ans += (a[i]+a[n-1-i])*(n-i)*(i+1)
if n % 2 == 1:
    ans += a[n//2]*(n//2+1)**2
print(ans)