結果

問題 No.1325 Subsequence Score
ユーザー AEnAEn
提出日時 2022-12-26 22:03:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 889 ms / 2,000 ms
コード長 211 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 173,456 KB
最終ジャッジ日時 2024-05-01 06:24:14
合計ジャッジ時間 13,161 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,728 KB
testcase_01 AC 37 ms
52,152 KB
testcase_02 AC 37 ms
53,436 KB
testcase_03 AC 46 ms
61,916 KB
testcase_04 AC 39 ms
53,944 KB
testcase_05 AC 45 ms
61,008 KB
testcase_06 AC 40 ms
52,792 KB
testcase_07 AC 45 ms
60,820 KB
testcase_08 AC 37 ms
53,332 KB
testcase_09 AC 36 ms
52,764 KB
testcase_10 AC 37 ms
53,536 KB
testcase_11 AC 39 ms
54,096 KB
testcase_12 AC 39 ms
53,072 KB
testcase_13 AC 871 ms
172,076 KB
testcase_14 AC 260 ms
97,952 KB
testcase_15 AC 727 ms
148,800 KB
testcase_16 AC 830 ms
161,828 KB
testcase_17 AC 377 ms
102,288 KB
testcase_18 AC 228 ms
94,812 KB
testcase_19 AC 889 ms
173,040 KB
testcase_20 AC 143 ms
85,276 KB
testcase_21 AC 311 ms
104,016 KB
testcase_22 AC 384 ms
104,296 KB
testcase_23 AC 883 ms
173,376 KB
testcase_24 AC 884 ms
173,440 KB
testcase_25 AC 885 ms
173,436 KB
testcase_26 AC 881 ms
173,456 KB
testcase_27 AC 883 ms
173,424 KB
testcase_28 AC 37 ms
52,772 KB
testcase_29 AC 37 ms
52,808 KB
testcase_30 AC 37 ms
52,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
a = list(map(int, input().split()))

res = 0
mod = 998244353

for i in range(1,N+1):
    res += (a[i-1]*((i-1)*pow(2,max(0,i-2),mod)+pow(2,i-1,mod))*pow(2,N-i,mod))%mod
    res %= mod
print(res)
0