結果

問題 No.2111 Sum of Diff
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-10-28 22:29:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 302 ms / 2,000 ms
コード長 201 bytes
コンパイル時間 1,340 ms
コンパイル使用メモリ 86,720 KB
実行使用メモリ 101,700 KB
最終ジャッジ日時 2023-09-20 05:35:15
合計ジャッジ時間 6,632 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,040 KB
testcase_01 AC 76 ms
71,380 KB
testcase_02 AC 302 ms
100,108 KB
testcase_03 AC 219 ms
98,316 KB
testcase_04 AC 103 ms
78,852 KB
testcase_05 AC 296 ms
100,388 KB
testcase_06 AC 298 ms
100,084 KB
testcase_07 AC 129 ms
82,500 KB
testcase_08 AC 145 ms
86,172 KB
testcase_09 AC 89 ms
76,392 KB
testcase_10 AC 94 ms
77,284 KB
testcase_11 AC 173 ms
91,020 KB
testcase_12 AC 171 ms
91,204 KB
testcase_13 AC 143 ms
84,700 KB
testcase_14 AC 250 ms
101,700 KB
testcase_15 AC 285 ms
99,920 KB
testcase_16 AC 164 ms
89,148 KB
testcase_17 AC 299 ms
100,204 KB
testcase_18 AC 138 ms
84,780 KB
testcase_19 AC 235 ms
101,392 KB
testcase_20 AC 296 ms
100,644 KB
testcase_21 AC 85 ms
76,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int,input().split()))
mod = 998244353

ans = 0
for i,a in enumerate(A):
    ans += a * pow(2,n-1-i,mod) % mod 
    ans -= a * pow(2,i,mod) % mod
    ans %= mod

print(ans)
0