結果
| 問題 | No.2717 Sum of Subarray of Subsequence |
| コンテスト | |
| ユーザー |
nikoro256
|
| 提出日時 | 2024-04-05 23:01:37 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 416 bytes |
| 記録 | |
| コンパイル時間 | 148 ms |
| コンパイル使用メモリ | 85,376 KB |
| 実行使用メモリ | 113,408 KB |
| 最終ジャッジ日時 | 2026-04-17 03:13:23 |
| 合計ジャッジ時間 | 10,568 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 3 WA * 19 |
ソースコード
N=int(input())
A=list(map(int,input().split()))
p=998244353
def exp(a,b,p):
ans,mul,div=1,a,1
for i in range(70):
if b//div%2==1:
ans*=mul
ans%=p
mul=mul**2%p
div*=2
return ans%p
left=[1]
l=0
for i in range(1,N+10):
left.append((1+i*exp(2,i-1,p)+exp(2,i,p)-1)%p)
l=left[-1]
ans=0
for i in range(N):
ans+=A[i]*left[i]*left[N-1-i]%p
print(ans)
nikoro256