結果

問題 No.2550 MORE! JUMP! MORE!
ユーザー titiatitia
提出日時 2023-11-30 02:59:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 464 ms / 2,000 ms
コード長 646 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 33,548 KB
最終ジャッジ日時 2023-11-30 02:59:15
合計ジャッジ時間 14,082 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
25,728 KB
testcase_01 AC 138 ms
25,728 KB
testcase_02 AC 135 ms
25,728 KB
testcase_03 AC 139 ms
25,728 KB
testcase_04 AC 142 ms
25,728 KB
testcase_05 AC 142 ms
25,728 KB
testcase_06 AC 145 ms
25,728 KB
testcase_07 AC 153 ms
25,728 KB
testcase_08 AC 141 ms
25,728 KB
testcase_09 AC 144 ms
25,728 KB
testcase_10 AC 142 ms
25,728 KB
testcase_11 AC 142 ms
25,728 KB
testcase_12 AC 138 ms
25,728 KB
testcase_13 AC 137 ms
25,728 KB
testcase_14 AC 132 ms
25,728 KB
testcase_15 AC 135 ms
25,728 KB
testcase_16 AC 149 ms
25,728 KB
testcase_17 AC 146 ms
25,728 KB
testcase_18 AC 139 ms
25,728 KB
testcase_19 AC 141 ms
25,728 KB
testcase_20 AC 337 ms
31,048 KB
testcase_21 AC 245 ms
29,148 KB
testcase_22 AC 174 ms
27,136 KB
testcase_23 AC 295 ms
32,008 KB
testcase_24 AC 408 ms
33,280 KB
testcase_25 AC 311 ms
32,392 KB
testcase_26 AC 268 ms
30,656 KB
testcase_27 AC 377 ms
33,524 KB
testcase_28 AC 375 ms
33,540 KB
testcase_29 AC 306 ms
31,248 KB
testcase_30 AC 429 ms
33,548 KB
testcase_31 AC 423 ms
33,548 KB
testcase_32 AC 464 ms
33,548 KB
testcase_33 AC 424 ms
33,544 KB
testcase_34 AC 416 ms
33,548 KB
testcase_35 AC 421 ms
33,548 KB
testcase_36 AC 425 ms
33,548 KB
testcase_37 AC 460 ms
33,544 KB
testcase_38 AC 432 ms
33,544 KB
testcase_39 AC 442 ms
33,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))

mod=998244353

FACT=[1]
for i in range(1,2*10**5+1):
    FACT.append(FACT[-1]*i%mod)

FACT_INV=[pow(FACT[-1],mod-2,mod)]
for i in range(2*10**5,0,-1):
    FACT_INV.append(FACT_INV[-1]*i%mod)

FACT_INV.reverse()

def Combi(a,b):
    if 0<=b<=a:
        return FACT[a]*FACT_INV[b]%mod*FACT_INV[a-b]%mod
    else:
        return 0

score=0

k=N-1

for i in range(k+1):
    score=(score+(i+1)*Combi(k,i))%mod

X=pow(2,k-1,mod)
INV=pow(2,mod-2,mod)

ANS=score*A[-1]%mod

#print(ANS)
now=2
for i in range(N-1):
    ANS=(ANS+now*X*A[i]*INV)%mod
    #print(now*X*INV%mod)
    now+=1


print(ANS%mod)
    
0