結果

問題 No.1325 Subsequence Score
ユーザー roarisroaris
提出日時 2020-12-22 15:06:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 678 ms / 2,000 ms
コード長 220 bytes
コンパイル時間 1,122 ms
コンパイル使用メモリ 81,664 KB
実行使用メモリ 172,644 KB
最終ジャッジ日時 2023-10-21 12:55:45
合計ジャッジ時間 9,843 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,372 KB
testcase_01 AC 39 ms
53,372 KB
testcase_02 AC 40 ms
53,372 KB
testcase_03 AC 46 ms
59,992 KB
testcase_04 AC 40 ms
53,372 KB
testcase_05 AC 46 ms
59,992 KB
testcase_06 AC 40 ms
53,372 KB
testcase_07 AC 46 ms
59,992 KB
testcase_08 AC 38 ms
53,372 KB
testcase_09 AC 39 ms
53,372 KB
testcase_10 AC 39 ms
53,372 KB
testcase_11 AC 39 ms
53,372 KB
testcase_12 AC 40 ms
53,372 KB
testcase_13 AC 669 ms
171,720 KB
testcase_14 AC 214 ms
95,952 KB
testcase_15 AC 567 ms
148,068 KB
testcase_16 AC 626 ms
160,956 KB
testcase_17 AC 295 ms
99,816 KB
testcase_18 AC 188 ms
93,124 KB
testcase_19 AC 676 ms
172,452 KB
testcase_20 AC 123 ms
84,012 KB
testcase_21 AC 250 ms
101,948 KB
testcase_22 AC 304 ms
101,752 KB
testcase_23 AC 678 ms
172,640 KB
testcase_24 AC 675 ms
172,644 KB
testcase_25 AC 677 ms
172,644 KB
testcase_26 AC 672 ms
172,644 KB
testcase_27 AC 673 ms
172,644 KB
testcase_28 AC 40 ms
53,372 KB
testcase_29 AC 38 ms
53,372 KB
testcase_30 AC 38 ms
53,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N = int(input())
a = list(map(int, input().split()))
ans = 0
MOD = 998244353

for i in range(N):
    ans += pow(2, i-1, MOD)*(i+2)*pow(2, N-i-1, MOD)*a[i]
    ans %= MOD

print(ans)
0