結果

問題 No.2111 Sum of Diff
コンテスト
ユーザー 𖧱𖦸𖥩𖥣𖥩𖥣
提出日時 2024-06-18 11:07:31
言語 Python3
(3.14.3 + numpy 2.4.2 + scipy 1.17.0)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 197 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 485 ms
コンパイル使用メモリ 20,956 KB
実行使用メモリ 52,468 KB
最終ジャッジ日時 2026-03-06 04:02:16
合計ジャッジ時間 55,090 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other WA * 3 TLE * 17
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n = int(input())
als = list(map(int,input().split()))
s = (als[0]-als[-1])*(2**(n-1)-1)
for i in range(n-2):
	s += als[i+1] * (2**(n-i-2)-1)
	s -= als[i+1] * (2**(i+1)-1)
	s %= 998244352
print(s)
	
0