結果
| 問題 |
No.2111 Sum of Diff
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-28 21:38:02 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 742 bytes |
| コンパイル時間 | 153 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 104,608 KB |
| 最終ジャッジ日時 | 2024-07-06 00:43:28 |
| 合計ジャッジ時間 | 2,876 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | WA * 20 |
ソースコード
import sys
input = lambda: sys.stdin.readline().rstrip()
import math, random
from bisect import bisect_right, bisect_left
from itertools import product, permutations, combinations, combinations_with_replacement
from collections import deque, defaultdict, Counter
from heapq import heapify, heappush, heappop
from functools import lru_cache, reduce
inf = float('inf')
def error(*args, sep=' ', end='\n'):
print(*args, sep=sep, end=end, file=sys.stderr)
def ltos(a, f=str, sep=' '):
return sep.join(map(f, a))
# mod = 1000000007
mod = 998244353
# sys.setrecursionlimit(10**6)
# ----------------------- #
n = int(input())
A = list(map(int, input().split()))
cnt = pow(2, n-1, mod)-1
ans = A[0] * cnt
ans -= A[-1] * cnt
print(ans % mod)