結果

問題 No.1325 Subsequence Score
ユーザー roarisroaris
提出日時 2020-12-22 15:08:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 704 ms / 2,000 ms
コード長 295 bytes
コンパイル時間 202 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 173,364 KB
最終ジャッジ日時 2024-09-21 14:12:40
合計ジャッジ時間 9,974 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
52,224 KB
testcase_01 AC 43 ms
51,968 KB
testcase_02 AC 40 ms
51,968 KB
testcase_03 AC 49 ms
59,904 KB
testcase_04 AC 42 ms
52,224 KB
testcase_05 AC 49 ms
60,800 KB
testcase_06 AC 41 ms
52,096 KB
testcase_07 AC 48 ms
60,032 KB
testcase_08 AC 40 ms
51,712 KB
testcase_09 AC 40 ms
52,096 KB
testcase_10 AC 41 ms
52,352 KB
testcase_11 AC 41 ms
52,480 KB
testcase_12 AC 42 ms
52,352 KB
testcase_13 AC 704 ms
172,248 KB
testcase_14 AC 222 ms
96,384 KB
testcase_15 AC 586 ms
148,532 KB
testcase_16 AC 664 ms
162,080 KB
testcase_17 AC 301 ms
100,352 KB
testcase_18 AC 188 ms
93,440 KB
testcase_19 AC 686 ms
173,364 KB
testcase_20 AC 122 ms
84,608 KB
testcase_21 AC 252 ms
102,272 KB
testcase_22 AC 310 ms
102,272 KB
testcase_23 AC 691 ms
173,024 KB
testcase_24 AC 692 ms
173,048 KB
testcase_25 AC 692 ms
173,036 KB
testcase_26 AC 692 ms
173,348 KB
testcase_27 AC 690 ms
173,332 KB
testcase_28 AC 36 ms
51,968 KB
testcase_29 AC 37 ms
51,968 KB
testcase_30 AC 37 ms
51,584 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):
    if i==0:
        ans += pow(2, N-i-1, MOD)*a[i]
    else:
        ans += pow(2, i-1, MOD)*(i+2)*pow(2, N-i-1, MOD)*a[i]
        
    ans %= MOD

print(ans)
0