結果

問題 No.2111 Sum of Diff
ユーザー titan23titan23
提出日時 2022-12-25 19:23:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 247 ms / 2,000 ms
コード長 272 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 107,520 KB
最終ジャッジ日時 2024-04-30 00:04:22
合計ジャッジ時間 5,020 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,584 KB
testcase_01 AC 40 ms
51,712 KB
testcase_02 AC 247 ms
102,272 KB
testcase_03 AC 164 ms
93,184 KB
testcase_04 AC 66 ms
65,920 KB
testcase_05 AC 247 ms
102,144 KB
testcase_06 AC 243 ms
101,760 KB
testcase_07 AC 80 ms
71,040 KB
testcase_08 AC 98 ms
75,904 KB
testcase_09 AC 48 ms
62,720 KB
testcase_10 AC 57 ms
63,872 KB
testcase_11 AC 122 ms
83,200 KB
testcase_12 AC 118 ms
82,816 KB
testcase_13 AC 91 ms
74,112 KB
testcase_14 AC 188 ms
98,756 KB
testcase_15 AC 222 ms
107,520 KB
testcase_16 AC 111 ms
80,000 KB
testcase_17 AC 237 ms
102,016 KB
testcase_18 AC 91 ms
74,624 KB
testcase_19 AC 178 ms
97,024 KB
testcase_20 AC 231 ms
102,144 KB
testcase_21 AC 42 ms
60,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda: sys.stdin.readline().rstrip()
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) - pow(2, i, mod))
  ans %= mod
print(ans % mod)  
0