結果

問題 No.2111 Sum of Diff
ユーザー kept1994kept1994
提出日時 2022-11-04 01:21:08
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 298 bytes
コンパイル時間 321 ms
コンパイル使用メモリ 86,988 KB
実行使用メモリ 105,008 KB
最終ジャッジ日時 2023-09-25 07:56:07
合計ジャッジ時間 5,816 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
78,408 KB
testcase_01 AC 70 ms
71,280 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
MOD = 998244353
def main():
    N = int(input())
    A = list(map(int, input().split()))
    ans = 0
    for i in range(N):
        ans += -A[i] * (2 ** i - 1) + A[i] * (2 ** (N - 1 - i) - 1)
        ans %= MOD
    print(ans)
    return

if __name__ == '__main__':
    main()
0