結果

問題 No.2111 Sum of Diff
ユーザー paruf4paruf4
提出日時 2022-10-28 23:59:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 306 ms / 2,000 ms
コード長 189 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 86,912 KB
実行使用メモリ 101,756 KB
最終ジャッジ日時 2023-09-20 07:20:48
合計ジャッジ時間 5,610 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,276 KB
testcase_01 AC 76 ms
71,536 KB
testcase_02 AC 306 ms
100,572 KB
testcase_03 AC 225 ms
98,720 KB
testcase_04 AC 108 ms
78,588 KB
testcase_05 AC 300 ms
100,652 KB
testcase_06 AC 303 ms
100,624 KB
testcase_07 AC 126 ms
82,600 KB
testcase_08 AC 149 ms
86,176 KB
testcase_09 AC 90 ms
76,612 KB
testcase_10 AC 95 ms
77,448 KB
testcase_11 AC 180 ms
91,716 KB
testcase_12 AC 175 ms
90,916 KB
testcase_13 AC 144 ms
85,180 KB
testcase_14 AC 255 ms
101,560 KB
testcase_15 AC 294 ms
99,780 KB
testcase_16 AC 163 ms
89,124 KB
testcase_17 AC 302 ms
100,456 KB
testcase_18 AC 142 ms
85,068 KB
testcase_19 AC 244 ms
101,756 KB
testcase_20 AC 301 ms
100,360 KB
testcase_21 AC 82 ms
76,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))

mod = 998244353
res = 0
for i in range(n):
    res += a[i]*(pow(2, n-1-i, mod)-1)
    res -= a[i]*(pow(2, i, mod)-1)

print(res % mod)
0