結果

問題 No.2111 Sum of Diff
ユーザー paruf4
提出日時 2022-10-28 23:48:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 206 bytes
コンパイル時間 890 ms
コンパイル使用メモリ 82,816 KB
実行使用メモリ 852,432 KB
最終ジャッジ日時 2024-07-06 03:07:07
合計ジャッジ時間 3,557 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other MLE * 1 -- * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
s = [0]*n
for i in range(1,n):
    s[i] = s[i-1] + 2**(i-1)
# print(s)
res = 0
cur = n
for i in range(n-1):
    res += (a[i]-a[-1+i])*s[-1+i]
print(res)
0