結果

問題 No.2111 Sum of Diff
ユーザー paruf4
提出日時 2022-10-28 23:51:47
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 234 bytes
コンパイル時間 189 ms
コンパイル使用メモリ 82,436 KB
実行使用メモリ 849,148 KB
最終ジャッジ日時 2024-07-06 03:11:53
合計ジャッジ時間 3,206 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
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] + pow(2,(i-1))
# print(s)
res = 0
mod = 998244353
for i in range(n-1):
    res += (a[i]-a[-1+i])*s[-1+i]
    res %= mod
print(res)

0