結果

問題 No.2111 Sum of Diff
ユーザー 👑 H20H20
提出日時 2022-10-28 22:11:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 312 ms / 2,000 ms
コード長 205 bytes
コンパイル時間 424 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 102,112 KB
最終ジャッジ日時 2023-09-20 05:11:22
合計ジャッジ時間 5,950 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,376 KB
testcase_01 AC 73 ms
71,484 KB
testcase_02 AC 312 ms
100,608 KB
testcase_03 AC 231 ms
98,812 KB
testcase_04 AC 108 ms
78,836 KB
testcase_05 AC 310 ms
100,488 KB
testcase_06 AC 309 ms
100,296 KB
testcase_07 AC 133 ms
83,008 KB
testcase_08 AC 153 ms
86,520 KB
testcase_09 AC 91 ms
76,500 KB
testcase_10 AC 99 ms
77,640 KB
testcase_11 AC 182 ms
91,352 KB
testcase_12 AC 179 ms
91,468 KB
testcase_13 AC 142 ms
85,068 KB
testcase_14 AC 259 ms
102,112 KB
testcase_15 AC 299 ms
100,240 KB
testcase_16 AC 167 ms
89,560 KB
testcase_17 AC 309 ms
100,560 KB
testcase_18 AC 146 ms
85,184 KB
testcase_19 AC 243 ms
101,740 KB
testcase_20 AC 309 ms
100,416 KB
testcase_21 AC 85 ms
76,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
mod = 998244353
ans = 0
for i,a in enumerate(A):
    ans += (pow(2,N-1-i,mod)-1)*a
for i,a in enumerate(A):
    ans -= (pow(2,i,mod)-1)*a
print(ans%mod)
0