結果

問題 No.1096 Range Sums
ユーザー convexineq
提出日時 2020-06-26 21:47:20
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 179 ms / 2,000 ms
コード長 230 bytes
コンパイル時間 114 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 23,100 KB
最終ジャッジ日時 2024-07-04 21:41:01
合計ジャッジ時間 1,859 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline

n,*a = map(int,read().split())

ans = 0
for i,ai in enumerate(a):
    v = (i+1) * (n-i) 
    ans += ai*v
    #print(v)

print(ans)

0