結果

問題 No.1325 Subsequence Score
ユーザー anagohirameanagohirame
提出日時 2020-12-23 00:13:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 213 ms / 2,000 ms
コード長 210 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 81,812 KB
実行使用メモリ 172,800 KB
最終ジャッジ日時 2023-10-21 13:10:27
合計ジャッジ時間 4,955 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,552 KB
testcase_01 AC 34 ms
53,552 KB
testcase_02 AC 34 ms
53,552 KB
testcase_03 AC 39 ms
60,072 KB
testcase_04 AC 35 ms
53,552 KB
testcase_05 AC 39 ms
60,072 KB
testcase_06 AC 35 ms
53,552 KB
testcase_07 AC 42 ms
60,072 KB
testcase_08 AC 35 ms
53,552 KB
testcase_09 AC 37 ms
53,552 KB
testcase_10 AC 38 ms
53,552 KB
testcase_11 AC 35 ms
53,552 KB
testcase_12 AC 36 ms
53,552 KB
testcase_13 AC 207 ms
171,724 KB
testcase_14 AC 86 ms
97,116 KB
testcase_15 AC 179 ms
148,300 KB
testcase_16 AC 195 ms
161,012 KB
testcase_17 AC 113 ms
101,980 KB
testcase_18 AC 81 ms
94,372 KB
testcase_19 AC 209 ms
172,508 KB
testcase_20 AC 63 ms
84,736 KB
testcase_21 AC 97 ms
103,680 KB
testcase_22 AC 116 ms
103,900 KB
testcase_23 AC 213 ms
172,800 KB
testcase_24 AC 209 ms
172,772 KB
testcase_25 AC 211 ms
172,728 KB
testcase_26 AC 209 ms
172,780 KB
testcase_27 AC 210 ms
172,780 KB
testcase_28 AC 34 ms
53,552 KB
testcase_29 AC 34 ms
53,552 KB
testcase_30 AC 34 ms
53,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353
n = int(input())
a = list(map(int, input().split()))
if n == 1:
	print(a[0] % MOD)
else:
	T = pow(2, n-2, MOD)
	ans = 0
	for i, x in enumerate(a):
		ans += (i+2) * x * T
		ans %= MOD
	print(ans)
0