結果
| 問題 |
No.1096 Range Sums
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-06-26 22:35:17 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 80 ms / 2,000 ms |
| コード長 | 222 bytes |
| コンパイル時間 | 173 ms |
| コンパイル使用メモリ | 82,376 KB |
| 実行使用メモリ | 98,304 KB |
| 最終ジャッジ日時 | 2024-07-04 22:20:00 |
| 合計ジャッジ時間 | 1,580 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
ソースコード
n = int(input())
a = list(map(int, input().split()))
s = sum(a)
total = 0
t = n//2 if n % 2 == 0 else n//2+1
total = s*n
df = 0
for i in range(1, t):
df += a[i-1] + a[-i]
total += (s - df) * (n-2*i)
print(total)