結果

問題 No.2111 Sum of Diff
ユーザー titiatitia
提出日時 2022-10-28 22:35:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 801 ms / 2,000 ms
コード長 169 bytes
コンパイル時間 128 ms
コンパイル使用メモリ 10,632 KB
実行使用メモリ 29,984 KB
最終ジャッジ日時 2023-09-20 05:41:50
合計ジャッジ時間 10,363 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,968 KB
testcase_01 AC 15 ms
7,764 KB
testcase_02 AC 796 ms
29,984 KB
testcase_03 AC 535 ms
22,908 KB
testcase_04 AC 105 ms
11,084 KB
testcase_05 AC 799 ms
29,856 KB
testcase_06 AC 801 ms
29,908 KB
testcase_07 AC 181 ms
13,272 KB
testcase_08 AC 254 ms
15,120 KB
testcase_09 AC 55 ms
9,488 KB
testcase_10 AC 72 ms
9,800 KB
testcase_11 AC 369 ms
18,464 KB
testcase_12 AC 357 ms
18,036 KB
testcase_13 AC 228 ms
14,464 KB
testcase_14 AC 652 ms
26,064 KB
testcase_15 AC 772 ms
28,956 KB
testcase_16 AC 313 ms
17,052 KB
testcase_17 AC 794 ms
29,928 KB
testcase_18 AC 233 ms
14,800 KB
testcase_19 AC 593 ms
24,512 KB
testcase_20 AC 792 ms
29,808 KB
testcase_21 AC 24 ms
8,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
mod=998244353

ANS=0

for i in range(N):
    x=pow(2,N-i-1,mod)-pow(2,i,mod)
    ANS+=x*A[i]
    ANS%=mod

print(ANS%mod)
0