結果

問題 No.1325 Subsequence Score
ユーザー first_vilfirst_vil
提出日時 2020-12-22 09:16:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 478 ms / 2,000 ms
コード長 329 bytes
コンパイル時間 1,012 ms
コンパイル使用メモリ 11,820 KB
実行使用メモリ 68,008 KB
最終ジャッジ日時 2023-10-21 12:42:24
合計ジャッジ時間 7,905 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,068 KB
testcase_01 AC 29 ms
10,068 KB
testcase_02 AC 29 ms
10,068 KB
testcase_03 AC 29 ms
10,200 KB
testcase_04 AC 29 ms
10,152 KB
testcase_05 AC 30 ms
10,268 KB
testcase_06 AC 29 ms
10,136 KB
testcase_07 AC 30 ms
10,212 KB
testcase_08 AC 29 ms
10,068 KB
testcase_09 AC 29 ms
10,088 KB
testcase_10 AC 29 ms
10,104 KB
testcase_11 AC 29 ms
10,136 KB
testcase_12 AC 29 ms
10,156 KB
testcase_13 AC 459 ms
68,008 KB
testcase_14 AC 148 ms
25,184 KB
testcase_15 AC 389 ms
60,040 KB
testcase_16 AC 439 ms
67,600 KB
testcase_17 AC 207 ms
32,620 KB
testcase_18 AC 131 ms
23,176 KB
testcase_19 AC 463 ms
65,708 KB
testcase_20 AC 84 ms
17,132 KB
testcase_21 AC 176 ms
28,452 KB
testcase_22 AC 211 ms
33,476 KB
testcase_23 AC 478 ms
66,760 KB
testcase_24 AC 476 ms
66,760 KB
testcase_25 AC 471 ms
66,760 KB
testcase_26 AC 477 ms
66,760 KB
testcase_27 AC 475 ms
66,760 KB
testcase_28 AC 28 ms
10,068 KB
testcase_29 AC 29 ms
10,068 KB
testcase_30 AC 29 ms
10,068 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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