結果

問題 No.2111 Sum of Diff
ユーザー prussian_coderprussian_coder
提出日時 2022-10-28 21:43:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 199 bytes
コンパイル時間 672 ms
コンパイル使用メモリ 87,052 KB
実行使用メモリ 100,780 KB
最終ジャッジ日時 2023-09-20 04:34:48
合計ジャッジ時間 4,177 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,408 KB
testcase_01 AC 73 ms
71,072 KB
testcase_02 AC 122 ms
100,524 KB
testcase_03 AC 102 ms
90,604 KB
testcase_04 AC 83 ms
78,208 KB
testcase_05 AC 122 ms
100,780 KB
testcase_06 AC 122 ms
100,436 KB
testcase_07 AC 87 ms
80,636 KB
testcase_08 AC 90 ms
82,900 KB
testcase_09 AC 81 ms
76,596 KB
testcase_10 AC 82 ms
77,372 KB
testcase_11 AC 94 ms
86,052 KB
testcase_12 AC 95 ms
85,716 KB
testcase_13 AC 88 ms
82,004 KB
testcase_14 AC 106 ms
92,752 KB
testcase_15 AC 121 ms
99,960 KB
testcase_16 AC 92 ms
84,760 KB
testcase_17 AC 122 ms
100,468 KB
testcase_18 AC 88 ms
81,816 KB
testcase_19 AC 104 ms
92,324 KB
testcase_20 AC 123 ms
100,580 KB
testcase_21 AC 79 ms
76,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=[int(x) for x in input().split()]
mod=998244353
L=1
R=pow(2,N-1,mod)
v=pow(2,mod-2,mod)
ans=0
for i in range(N):
	ans+=A[i]*(R-L)%mod
	ans%=mod
	L*=2
	L%=mod
	R*=v
	R%=mod
print(ans)
0