結果

問題 No.1096 Range Sums
ユーザー U SU S
提出日時 2020-06-26 22:37:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 176 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 87,260 KB
実行使用メモリ 118,984 KB
最終ジャッジ日時 2023-09-18 06:08:22
合計ジャッジ時間 2,519 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,272 KB
testcase_01 AC 76 ms
71,316 KB
testcase_02 AC 76 ms
71,420 KB
testcase_03 AC 79 ms
71,376 KB
testcase_04 AC 74 ms
71,336 KB
testcase_05 AC 74 ms
71,220 KB
testcase_06 AC 74 ms
71,588 KB
testcase_07 AC 73 ms
71,460 KB
testcase_08 AC 75 ms
71,488 KB
testcase_09 AC 74 ms
71,372 KB
testcase_10 AC 124 ms
118,984 KB
testcase_11 AC 121 ms
118,912 KB
testcase_12 AC 122 ms
118,716 KB
testcase_13 AC 123 ms
118,916 KB
testcase_14 AC 121 ms
118,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int,input().split()))
num = [n]
for i in range(1,n):
    num.append(num[i-1]-i+n-i)
ans = 0
for i in range(n):
    ans += a[i]*num[i]
print(ans)

0