結果
問題 |
No.2550 MORE! JUMP! MORE!
|
ユーザー |
![]() |
提出日時 | 2025-02-23 08:35:52 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 150 ms / 2,000 ms |
コード長 | 290 bytes |
コンパイル時間 | 353 ms |
コンパイル使用メモリ | 82,900 KB |
実行使用メモリ | 113,280 KB |
最終ジャッジ日時 | 2025-02-23 08:36:01 |
合計ジャッジ時間 | 5,761 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 40 |
ソースコード
n=int(input()) a=list(map(int,input().split())) if n==1: print(a[0]) exit() M=998244353 two=[1] for i in range(n): two+=[two[-1]*2%M] c=0 c+=a[0]*two[n-2] c%=M for i in range(1,n-1): c+=(i*two[i-1]+two[i])*a[i]*two[n-i-1-1] c%=M c+=((n-1)*two[n-1-1]+two[n-1])*a[n-1] c%=M print(c)