結果

問題 No.1325 Subsequence Score
ユーザー tktk_snsntktk_snsn
提出日時 2020-12-22 02:54:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 154 ms / 2,000 ms
コード長 256 bytes
コンパイル時間 472 ms
コンパイル使用メモリ 81,684 KB
実行使用メモリ 153,408 KB
最終ジャッジ日時 2023-10-21 12:23:21
合計ジャッジ時間 4,366 ms
ジャッジサーバーID
(参考情報)
judge9 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,304 KB
testcase_01 AC 38 ms
53,304 KB
testcase_02 AC 38 ms
53,304 KB
testcase_03 AC 43 ms
59,792 KB
testcase_04 AC 39 ms
53,304 KB
testcase_05 AC 43 ms
59,792 KB
testcase_06 AC 39 ms
53,304 KB
testcase_07 AC 43 ms
59,792 KB
testcase_08 AC 38 ms
53,304 KB
testcase_09 AC 39 ms
53,304 KB
testcase_10 AC 39 ms
53,304 KB
testcase_11 AC 39 ms
53,304 KB
testcase_12 AC 39 ms
53,304 KB
testcase_13 AC 154 ms
153,020 KB
testcase_14 AC 75 ms
94,224 KB
testcase_15 AC 133 ms
135,192 KB
testcase_16 AC 142 ms
144,372 KB
testcase_17 AC 98 ms
101,756 KB
testcase_18 AC 70 ms
89,320 KB
testcase_19 AC 151 ms
153,352 KB
testcase_20 AC 59 ms
75,496 KB
testcase_21 AC 83 ms
101,100 KB
testcase_22 AC 102 ms
103,652 KB
testcase_23 AC 151 ms
153,404 KB
testcase_24 AC 150 ms
153,408 KB
testcase_25 AC 150 ms
153,404 KB
testcase_26 AC 150 ms
153,404 KB
testcase_27 AC 148 ms
153,408 KB
testcase_28 AC 38 ms
53,304 KB
testcase_29 AC 38 ms
53,304 KB
testcase_30 AC 37 ms
53,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

if N == 1:
    print(A[0] % mod)
    exit()

ans = 0
cnt = pow(2, N - 1, mod)
d = pow(2, N - 2, mod)
for a in A:
    ans += a * cnt
    ans %= mod
    cnt += d
    cnt %= mod

print(ans)
0