結果

問題 No.2550 MORE! JUMP! MORE!
ユーザー hato336
提出日時 2023-11-25 13:38:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 649 bytes
コンパイル時間 308 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 121,984 KB
最終ジャッジ日時 2024-09-26 10:29:55
合計ジャッジ時間 11,735 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 39 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
#sys.set_int_max_str_digits(0)
n = int(input())
#
#alist = []
#s = input()

#for i in range(n):
#    alist.append(list(map(int,input().split())))

alist = list(map(int,input().split()))
mod = 998244353
ans = 0
for i in range(1,n+1):
    if i == 1:
        ans += alist[i-1] * pow(2,n-i-1,mod)
        ans %= mod
        continue
    if i == n:
        ans += alist[i-1] * pow(2,i-2,mod) * (i+1)
        ans %= mod
        continue
    ans += alist[i-1] * pow(2,i-2,mod) * (i+1) * pow(2,n-i-1,mod)
    ans %= mod
print(ans)
0