結果

問題 No.2111 Sum of Diff
ユーザー shobonvipshobonvip
提出日時 2022-10-28 21:46:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 299 ms / 2,000 ms
コード長 193 bytes
コンパイル時間 1,175 ms
コンパイル使用メモリ 86,956 KB
実行使用メモリ 101,836 KB
最終ジャッジ日時 2023-09-20 04:39:02
合計ジャッジ時間 6,571 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,252 KB
testcase_01 AC 76 ms
71,528 KB
testcase_02 AC 299 ms
100,524 KB
testcase_03 AC 225 ms
98,740 KB
testcase_04 AC 100 ms
78,812 KB
testcase_05 AC 294 ms
100,688 KB
testcase_06 AC 299 ms
100,408 KB
testcase_07 AC 123 ms
82,744 KB
testcase_08 AC 145 ms
86,204 KB
testcase_09 AC 88 ms
76,520 KB
testcase_10 AC 94 ms
77,352 KB
testcase_11 AC 172 ms
91,212 KB
testcase_12 AC 169 ms
91,240 KB
testcase_13 AC 135 ms
84,924 KB
testcase_14 AC 250 ms
101,816 KB
testcase_15 AC 286 ms
99,832 KB
testcase_16 AC 157 ms
89,344 KB
testcase_17 AC 293 ms
100,324 KB
testcase_18 AC 140 ms
84,840 KB
testcase_19 AC 234 ms
101,836 KB
testcase_20 AC 293 ms
100,464 KB
testcase_21 AC 83 ms
76,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(n):
	ans += a[i] * (pow(2, n-i-1, mod) - 1)
	ans -= a[i] * (pow(2, i, mod) - 1)
	ans %= mod
print(ans)
0