結果

問題 No.1325 Subsequence Score
ユーザー first_vilfirst_vil
提出日時 2020-12-22 09:25:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 226 ms / 2,000 ms
コード長 312 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 81,764 KB
実行使用メモリ 172,444 KB
最終ジャッジ日時 2023-10-21 12:43:54
合計ジャッジ時間 5,064 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
53,460 KB
testcase_01 AC 39 ms
53,460 KB
testcase_02 AC 40 ms
53,460 KB
testcase_03 AC 45 ms
59,712 KB
testcase_04 AC 39 ms
53,460 KB
testcase_05 AC 44 ms
59,712 KB
testcase_06 AC 39 ms
53,460 KB
testcase_07 AC 45 ms
59,712 KB
testcase_08 AC 39 ms
53,460 KB
testcase_09 AC 40 ms
53,460 KB
testcase_10 AC 40 ms
53,460 KB
testcase_11 AC 39 ms
53,460 KB
testcase_12 AC 40 ms
53,460 KB
testcase_13 AC 220 ms
171,376 KB
testcase_14 AC 94 ms
95,480 KB
testcase_15 AC 193 ms
147,820 KB
testcase_16 AC 208 ms
161,004 KB
testcase_17 AC 123 ms
99,944 KB
testcase_18 AC 87 ms
92,916 KB
testcase_19 AC 223 ms
172,156 KB
testcase_20 AC 71 ms
83,804 KB
testcase_21 AC 106 ms
101,476 KB
testcase_22 AC 128 ms
101,816 KB
testcase_23 AC 222 ms
172,352 KB
testcase_24 AC 226 ms
172,356 KB
testcase_25 AC 226 ms
172,444 KB
testcase_26 AC 223 ms
172,352 KB
testcase_27 AC 223 ms
172,352 KB
testcase_28 AC 41 ms
53,460 KB
testcase_29 AC 39 ms
53,460 KB
testcase_30 AC 40 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    import sys
    input=sys.stdin.readline
    mod=998244353
    n=int(input())
    if n==1:
        print(int(input())%mod)
        return
    a=list(map(int,input().split()))
    
    p=pow(2,n-2,mod)
    
    ans=0
    for i in range(n):
        ans=(ans+a[i]*(p*2+i*p))%mod
    print(ans)
main()
0