結果

問題 No.1325 Subsequence Score
ユーザー ああいいああいい
提出日時 2022-03-12 17:47:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 852 ms / 2,000 ms
コード長 213 bytes
コンパイル時間 1,457 ms
コンパイル使用メモリ 81,516 KB
実行使用メモリ 172,556 KB
最終ジャッジ日時 2023-10-17 02:55:08
合計ジャッジ時間 15,186 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,356 KB
testcase_01 AC 36 ms
53,356 KB
testcase_02 AC 36 ms
53,356 KB
testcase_03 AC 43 ms
59,916 KB
testcase_04 AC 37 ms
53,356 KB
testcase_05 AC 44 ms
61,964 KB
testcase_06 AC 38 ms
53,356 KB
testcase_07 AC 44 ms
59,916 KB
testcase_08 AC 35 ms
53,356 KB
testcase_09 AC 37 ms
53,356 KB
testcase_10 AC 37 ms
53,356 KB
testcase_11 AC 37 ms
53,356 KB
testcase_12 AC 37 ms
53,356 KB
testcase_13 AC 842 ms
171,312 KB
testcase_14 AC 251 ms
97,192 KB
testcase_15 AC 701 ms
148,164 KB
testcase_16 AC 793 ms
161,220 KB
testcase_17 AC 364 ms
101,804 KB
testcase_18 AC 222 ms
94,184 KB
testcase_19 AC 851 ms
172,020 KB
testcase_20 AC 137 ms
82,772 KB
testcase_21 AC 303 ms
103,492 KB
testcase_22 AC 378 ms
103,668 KB
testcase_23 AC 851 ms
172,552 KB
testcase_24 AC 851 ms
172,556 KB
testcase_25 AC 852 ms
172,556 KB
testcase_26 AC 851 ms
172,556 KB
testcase_27 AC 847 ms
172,556 KB
testcase_28 AC 36 ms
53,356 KB
testcase_29 AC 36 ms
53,356 KB
testcase_30 AC 36 ms
53,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
a = list(map(int,input().split()))
ans = 0
P = 998244353
for i in range(N):
    i += 1
    tmp = pow(2,N-i,P) * (pow(2,i-1,P)+(i-1)*pow(2,i-2,P))%P
    ans += a[i-1] * tmp
    ans %= P
print(ans)
0