結果

問題 No.1325 Subsequence Score
ユーザー first_vilfirst_vil
提出日時 2020-12-22 09:16:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 260 ms / 2,000 ms
コード長 329 bytes
コンパイル時間 169 ms
コンパイル使用メモリ 81,592 KB
実行使用メモリ 176,396 KB
最終ジャッジ日時 2023-10-21 12:42:30
合計ジャッジ時間 5,385 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,348 KB
testcase_01 AC 38 ms
53,348 KB
testcase_02 AC 38 ms
53,348 KB
testcase_03 AC 45 ms
59,748 KB
testcase_04 AC 40 ms
53,368 KB
testcase_05 AC 46 ms
61,824 KB
testcase_06 AC 39 ms
53,368 KB
testcase_07 AC 45 ms
59,776 KB
testcase_08 AC 38 ms
53,368 KB
testcase_09 AC 39 ms
53,368 KB
testcase_10 AC 39 ms
53,368 KB
testcase_11 AC 39 ms
53,368 KB
testcase_12 AC 39 ms
53,368 KB
testcase_13 AC 254 ms
175,348 KB
testcase_14 AC 105 ms
96,688 KB
testcase_15 AC 220 ms
150,800 KB
testcase_16 AC 241 ms
164,656 KB
testcase_17 AC 137 ms
100,172 KB
testcase_18 AC 98 ms
93,860 KB
testcase_19 AC 257 ms
176,128 KB
testcase_20 AC 76 ms
84,220 KB
testcase_21 AC 121 ms
102,948 KB
testcase_22 AC 143 ms
102,324 KB
testcase_23 AC 259 ms
176,396 KB
testcase_24 AC 260 ms
176,388 KB
testcase_25 AC 258 ms
176,392 KB
testcase_26 AC 260 ms
176,392 KB
testcase_27 AC 259 ms
176,392 KB
testcase_28 AC 39 ms
53,368 KB
testcase_29 AC 39 ms
53,368 KB
testcase_30 AC 38 ms
53,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    import sys
    input=sys.stdin.readline
    mod=998244353
    n=int(input())
    a=list(map(int,input().split()))
    
    pow2=[1]*n
    for i in range(1,n):
        pow2[i]=pow2[i-1]*2%mod
    
    ans=0
    for i in range(n):
        ans=(ans+a[i]*((pow2[i]+pow2[i-1]*i)*pow2[n-i-1]))%mod
    print(ans)
main()
0