結果

問題 No.2111 Sum of Diff
ユーザー 👑 timitimi
提出日時 2022-10-28 21:47:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 148 ms / 2,000 ms
コード長 235 bytes
コンパイル時間 1,009 ms
コンパイル使用メモリ 86,488 KB
実行使用メモリ 113,916 KB
最終ジャッジ日時 2023-09-20 04:40:20
合計ジャッジ時間 4,791 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
89,792 KB
testcase_01 AC 91 ms
89,448 KB
testcase_02 AC 148 ms
113,564 KB
testcase_03 AC 128 ms
112,460 KB
testcase_04 AC 99 ms
92,312 KB
testcase_05 AC 144 ms
113,748 KB
testcase_06 AC 143 ms
113,808 KB
testcase_07 AC 103 ms
96,100 KB
testcase_08 AC 108 ms
99,648 KB
testcase_09 AC 98 ms
90,032 KB
testcase_10 AC 96 ms
90,972 KB
testcase_11 AC 114 ms
104,648 KB
testcase_12 AC 116 ms
104,676 KB
testcase_13 AC 107 ms
98,192 KB
testcase_14 AC 127 ms
101,892 KB
testcase_15 AC 145 ms
113,332 KB
testcase_16 AC 113 ms
102,840 KB
testcase_17 AC 145 ms
113,760 KB
testcase_18 AC 107 ms
98,236 KB
testcase_19 AC 127 ms
101,576 KB
testcase_20 AC 144 ms
113,916 KB
testcase_21 AC 95 ms
90,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int, input().split()))
mod=998244353
D=[1]
for i in range(2*10**5):
  d=D[-1]*2
  d%=mod
  D.append(d)
ans=0
for i in range(N):
  a,b=(D[N-1-i]-1)%mod,(D[i]-1)%mod
  ans+=A[i]*((a-b)%mod)
  ans%=mod
print(ans)
0