結果
| 問題 | No.2111 Sum of Diff |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-31 10:51:23 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 183 ms / 2,000 ms |
| + 427µs | |
| コード長 | 282 bytes |
| 記録 | |
| コンパイル時間 | 2,199 ms |
| コンパイル使用メモリ | 96,104 KB |
| 実行使用メモリ | 116,864 KB |
| 最終ジャッジ日時 | 2026-08-12 01:00:47 |
| 合計ジャッジ時間 | 5,652 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 20 |
ソースコード
N = int(input())
a = list(map(int,input().split()))
P = 998244353
ans = 0
sub = a[0]
for i in range(1,N):
tmp = a[i] * (pow(2,i,P)-1) % P
ans += pow(2,N - i - 1,P) * (tmp - sub) % P
sub += a[i] * pow(2,i,P)
sub %= P
ans %= P
#print(ans,sub)
print((-ans)%P)