結果

問題 No.1325 Subsequence Score
ユーザー rlangevinrlangevin
提出日時 2023-02-21 12:33:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 291 ms / 2,000 ms
コード長 272 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 86,832 KB
実行使用メモリ 177,724 KB
最終ジャッジ日時 2023-09-29 06:06:53
合計ジャッジ時間 9,209 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
70,796 KB
testcase_01 AC 75 ms
70,788 KB
testcase_02 AC 75 ms
70,560 KB
testcase_03 AC 94 ms
75,840 KB
testcase_04 AC 76 ms
70,784 KB
testcase_05 AC 84 ms
75,792 KB
testcase_06 AC 77 ms
70,848 KB
testcase_07 AC 82 ms
75,932 KB
testcase_08 AC 77 ms
70,756 KB
testcase_09 AC 76 ms
70,824 KB
testcase_10 AC 77 ms
70,696 KB
testcase_11 AC 76 ms
70,884 KB
testcase_12 AC 78 ms
70,656 KB
testcase_13 AC 284 ms
177,340 KB
testcase_14 AC 139 ms
99,012 KB
testcase_15 AC 245 ms
155,064 KB
testcase_16 AC 266 ms
167,956 KB
testcase_17 AC 167 ms
101,492 KB
testcase_18 AC 131 ms
96,168 KB
testcase_19 AC 291 ms
177,724 KB
testcase_20 AC 111 ms
85,996 KB
testcase_21 AC 151 ms
105,140 KB
testcase_22 AC 170 ms
103,236 KB
testcase_23 AC 267 ms
145,372 KB
testcase_24 AC 262 ms
145,464 KB
testcase_25 AC 266 ms
145,372 KB
testcase_26 AC 269 ms
145,372 KB
testcase_27 AC 268 ms
145,432 KB
testcase_28 AC 76 ms
70,692 KB
testcase_29 AC 75 ms
70,872 KB
testcase_30 AC 75 ms
70,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
mod = 998244353
ans = 0
two = [1] * (N + 1)
for i in range(N):
    two[i + 1] = two[i] * 2
    two[i + 1] %= mod

for i in range(N):
    ans += (two[i] + i * two[i - 1]) * A[i] * two[N - 1 - i]
    ans %= mod
print(ans)
0