結果

問題 No.1325 Subsequence Score
ユーザー 👑 tamatotamato
提出日時 2020-12-22 00:22:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 162 ms / 2,000 ms
コード長 432 bytes
コンパイル時間 169 ms
コンパイル使用メモリ 81,924 KB
実行使用メモリ 157,408 KB
最終ジャッジ日時 2023-10-21 12:12:17
合計ジャッジ時間 4,313 ms
ジャッジサーバーID
(参考情報)
judge11 / judge9
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,620 KB
testcase_01 AC 38 ms
53,620 KB
testcase_02 AC 38 ms
53,620 KB
testcase_03 AC 45 ms
59,920 KB
testcase_04 AC 39 ms
53,620 KB
testcase_05 AC 44 ms
59,920 KB
testcase_06 AC 38 ms
53,620 KB
testcase_07 AC 45 ms
59,920 KB
testcase_08 AC 38 ms
53,620 KB
testcase_09 AC 37 ms
53,620 KB
testcase_10 AC 38 ms
53,620 KB
testcase_11 AC 39 ms
53,620 KB
testcase_12 AC 39 ms
53,620 KB
testcase_13 AC 162 ms
157,180 KB
testcase_14 AC 78 ms
94,100 KB
testcase_15 AC 142 ms
138,520 KB
testcase_16 AC 149 ms
148,112 KB
testcase_17 AC 104 ms
100,312 KB
testcase_18 AC 73 ms
89,228 KB
testcase_19 AC 159 ms
157,408 KB
testcase_20 AC 59 ms
77,556 KB
testcase_21 AC 88 ms
101,768 KB
testcase_22 AC 108 ms
102,448 KB
testcase_23 AC 159 ms
157,396 KB
testcase_24 AC 159 ms
157,396 KB
testcase_25 AC 159 ms
157,396 KB
testcase_26 AC 161 ms
157,400 KB
testcase_27 AC 161 ms
157,396 KB
testcase_28 AC 38 ms
53,620 KB
testcase_29 AC 38 ms
53,620 KB
testcase_30 AC 38 ms
53,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

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

    pow2 = [1] * (N+1)
    for i in range(1, N+1):
        pow2[i] = (pow2[i-1] * 2)%mod

    ans = 0
    for i, a in enumerate(A):
        ans = (ans + ((a * ((pow2[i-1] * i)%mod + pow2[i])%mod)%mod * pow2[N-i-1])%mod)%mod
    print(ans)



if __name__ == '__main__':
    main()
0