結果

問題 No.2111 Sum of Diff
ユーザー SidewaysOwlSidewaysOwl
提出日時 2022-10-28 23:07:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 299 ms / 2,000 ms
コード長 194 bytes
コンパイル時間 539 ms
コンパイル使用メモリ 86,908 KB
実行使用メモリ 102,000 KB
最終ジャッジ日時 2023-09-20 06:21:49
合計ジャッジ時間 5,701 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,452 KB
testcase_01 AC 76 ms
71,016 KB
testcase_02 AC 297 ms
100,628 KB
testcase_03 AC 219 ms
98,516 KB
testcase_04 AC 105 ms
78,848 KB
testcase_05 AC 295 ms
100,616 KB
testcase_06 AC 294 ms
100,476 KB
testcase_07 AC 125 ms
82,648 KB
testcase_08 AC 145 ms
86,228 KB
testcase_09 AC 90 ms
76,452 KB
testcase_10 AC 95 ms
77,428 KB
testcase_11 AC 174 ms
91,352 KB
testcase_12 AC 173 ms
91,136 KB
testcase_13 AC 136 ms
84,944 KB
testcase_14 AC 248 ms
102,000 KB
testcase_15 AC 284 ms
99,996 KB
testcase_16 AC 161 ms
89,404 KB
testcase_17 AC 299 ms
100,496 KB
testcase_18 AC 141 ms
84,852 KB
testcase_19 AC 236 ms
101,500 KB
testcase_20 AC 293 ms
100,528 KB
testcase_21 AC 80 ms
76,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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