結果

問題 No.2111 Sum of Diff
ユーザー 👑 KazunKazun
提出日時 2022-10-28 21:52:05
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 144 ms / 2,000 ms
コード長 341 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 102,940 KB
最終ジャッジ日時 2023-09-20 04:45:31
合計ジャッジ時間 3,955 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,128 KB
testcase_01 AC 78 ms
71,096 KB
testcase_02 AC 144 ms
101,448 KB
testcase_03 AC 110 ms
99,268 KB
testcase_04 AC 83 ms
78,312 KB
testcase_05 AC 137 ms
101,200 KB
testcase_06 AC 135 ms
101,248 KB
testcase_07 AC 94 ms
82,488 KB
testcase_08 AC 100 ms
86,192 KB
testcase_09 AC 85 ms
76,068 KB
testcase_10 AC 85 ms
76,972 KB
testcase_11 AC 100 ms
91,584 KB
testcase_12 AC 100 ms
91,396 KB
testcase_13 AC 92 ms
84,636 KB
testcase_14 AC 120 ms
102,940 KB
testcase_15 AC 132 ms
100,808 KB
testcase_16 AC 96 ms
89,576 KB
testcase_17 AC 133 ms
101,064 KB
testcase_18 AC 91 ms
84,976 KB
testcase_19 AC 115 ms
102,304 KB
testcase_20 AC 135 ms
101,148 KB
testcase_21 AC 76 ms
76,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    N=int(input())
    A=list(map(int,input().split()))

    Mod=998244353
    two=[1]*(N+1)
    for i in range(1,N+1):
        two[i]=(2*two[i-1])%Mod

    ans=0
    for i in range(N):
        ans+=(two[N-1-i]-two[i])*A[i]
        ans%=Mod
    return ans%Mod

#==================================================
print(solve())
0