結果

問題 No.2550 MORE! JUMP! MORE!
ユーザー Nullz
提出日時 2023-11-25 13:31:39
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 429 bytes
コンパイル時間 326 ms
コンパイル使用メモリ 82,068 KB
実行使用メモリ 103,200 KB
最終ジャッジ日時 2024-09-26 10:27:37
合計ジャッジ時間 5,544 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20 TLE * 1 -- * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import comb

mod = 998244353
n = int(input())
a = [*map(int, input().split())]
ans = 0
for i, v in enumerate(a):
    res = 0
    if i < n - 1:
        for j in range(i + 1):
            res = (res + comb(i, j) * (j + 1) * v) % mod
        res = (res * pow(2, n - 2 - i, mod)) % mod
    else:
        for j in range(n):
            res = (res + comb(n - 1, j) * (j + 1) * v) % mod
    ans = (ans + res) % mod
print(ans)
0