結果

問題 No.2111 Sum of Diff
ユーザー roarisroaris
提出日時 2022-10-28 23:28:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 173 ms / 2,000 ms
コード長 299 bytes
コンパイル時間 643 ms
コンパイル使用メモリ 87,008 KB
実行使用メモリ 122,332 KB
最終ジャッジ日時 2023-09-20 06:45:03
合計ジャッジ時間 4,966 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
71,632 KB
testcase_01 AC 94 ms
71,296 KB
testcase_02 AC 173 ms
122,324 KB
testcase_03 AC 137 ms
107,604 KB
testcase_04 AC 106 ms
80,212 KB
testcase_05 AC 152 ms
122,320 KB
testcase_06 AC 153 ms
122,308 KB
testcase_07 AC 114 ms
85,960 KB
testcase_08 AC 121 ms
90,708 KB
testcase_09 AC 105 ms
77,844 KB
testcase_10 AC 105 ms
78,548 KB
testcase_11 AC 126 ms
97,788 KB
testcase_12 AC 124 ms
97,012 KB
testcase_13 AC 117 ms
89,040 KB
testcase_14 AC 143 ms
112,176 KB
testcase_15 AC 152 ms
122,216 KB
testcase_16 AC 122 ms
94,476 KB
testcase_17 AC 154 ms
122,332 KB
testcase_18 AC 118 ms
89,024 KB
testcase_19 AC 146 ms
112,072 KB
testcase_20 AC 161 ms
122,308 KB
testcase_21 AC 108 ms
77,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

N = int(input())
A = list(map(int, input().split()))
ans = 0
MOD = 998244353
p = [1]

for i in range(N+10):
    p.append(p[-1]*2%MOD)

for i in range(N):
    ans += p[N-1-i]*A[i]%MOD
    ans -= p[i]*A[i]%MOD
    ans %= MOD

print(ans)
0