結果

問題 No.1325 Subsequence Score
ユーザー trineutrontrineutron
提出日時 2020-12-22 02:46:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 193 ms / 2,000 ms
コード長 210 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 81,688 KB
実行使用メモリ 172,648 KB
最終ジャッジ日時 2023-10-21 12:22:57
合計ジャッジ時間 4,762 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,404 KB
testcase_01 AC 38 ms
53,404 KB
testcase_02 AC 38 ms
53,404 KB
testcase_03 AC 43 ms
59,912 KB
testcase_04 AC 38 ms
53,404 KB
testcase_05 AC 43 ms
59,912 KB
testcase_06 AC 38 ms
53,404 KB
testcase_07 AC 42 ms
59,912 KB
testcase_08 AC 38 ms
53,404 KB
testcase_09 AC 38 ms
53,404 KB
testcase_10 AC 38 ms
53,404 KB
testcase_11 AC 38 ms
53,404 KB
testcase_12 AC 38 ms
53,404 KB
testcase_13 AC 190 ms
171,568 KB
testcase_14 AC 84 ms
96,972 KB
testcase_15 AC 165 ms
148,140 KB
testcase_16 AC 180 ms
160,856 KB
testcase_17 AC 108 ms
101,820 KB
testcase_18 AC 79 ms
94,228 KB
testcase_19 AC 190 ms
172,352 KB
testcase_20 AC 65 ms
84,592 KB
testcase_21 AC 93 ms
103,536 KB
testcase_22 AC 111 ms
103,744 KB
testcase_23 AC 189 ms
172,544 KB
testcase_24 AC 191 ms
172,552 KB
testcase_25 AC 193 ms
172,648 KB
testcase_26 AC 189 ms
172,548 KB
testcase_27 AC 191 ms
172,548 KB
testcase_28 AC 38 ms
53,404 KB
testcase_29 AC 38 ms
53,404 KB
testcase_30 AC 38 ms
53,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353
n = int(input())
a = list(map(int, input().split()))
if n == 1:
    print(a[0] % mod)
    exit()
ans = 0
k = pow(2, n - 2, mod)
for i in range(n):
    ans += k * (i + 2) * a[i]
print(ans % mod)
0