結果

問題 No.1325 Subsequence Score
ユーザー flippergoflippergo
提出日時 2020-12-31 00:14:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 179 ms / 2,000 ms
コード長 278 bytes
コンパイル時間 169 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 154,284 KB
最終ジャッジ日時 2024-04-17 00:36:57
合計ジャッジ時間 4,407 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
51,968 KB
testcase_01 AC 42 ms
51,584 KB
testcase_02 AC 40 ms
51,840 KB
testcase_03 AC 46 ms
59,264 KB
testcase_04 AC 41 ms
52,096 KB
testcase_05 AC 47 ms
59,392 KB
testcase_06 AC 41 ms
51,968 KB
testcase_07 AC 47 ms
59,520 KB
testcase_08 AC 39 ms
51,712 KB
testcase_09 AC 39 ms
52,096 KB
testcase_10 AC 40 ms
51,968 KB
testcase_11 AC 40 ms
52,096 KB
testcase_12 AC 41 ms
52,096 KB
testcase_13 AC 179 ms
153,716 KB
testcase_14 AC 85 ms
93,184 KB
testcase_15 AC 155 ms
135,592 KB
testcase_16 AC 169 ms
144,792 KB
testcase_17 AC 112 ms
102,144 KB
testcase_18 AC 81 ms
89,216 KB
testcase_19 AC 178 ms
154,284 KB
testcase_20 AC 66 ms
75,520 KB
testcase_21 AC 95 ms
101,632 KB
testcase_22 AC 116 ms
104,320 KB
testcase_23 AC 178 ms
153,696 KB
testcase_24 AC 176 ms
154,076 KB
testcase_25 AC 178 ms
154,204 KB
testcase_26 AC 176 ms
153,564 KB
testcase_27 AC 177 ms
153,696 KB
testcase_28 AC 40 ms
51,456 KB
testcase_29 AC 39 ms
51,712 KB
testcase_30 AC 40 ms
51,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

p = 998244353
N = int(input())
A = list(map(int,input().split()))
A.insert(0,0)
if N==1:
    ans = A[1]%p
else:
    a = 1
    i = 0
    while i<N-2:
        a = (a*2)%p
        i += 1
    b = 0
    for i in range(1,N+1):
        b = (b+(i+1)*A[i])%p
    ans = (a*b)%p
print(ans)
0