API Response (JSON)
{
"problem": {
"name": "D. Imbalanced Array",
"description": {
"content": "You are given an array _a_ consisting of _n_ elements. The _imbalance value_ of some subsegment of this array is the difference between the maximum and minimum element from this segment. The _imbalanc",
"description_type": "Markdown"
},
"platform": "Codeforces",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "CF817D"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given an array _a_ consisting of _n_ elements. The _imbalance value_ of some subsegment of this array is the difference between the maximum and minimum element from this segment. The _imbalanc...",
"is_translate": false,
"language": "English"
},
{
"statement_type": "Markdown",
"content": "你被给定一个包含 $n$ 个元素的数组 $[a]$。该数组某个子段的 _不平衡值_ 定义为该子段中最大元素与最小元素的差。数组的 _不平衡值_ 是该数组所有子段的 _不平衡值_ 之和。\n\n例如,数组 $[1, 4, 1]$ 的 _不平衡值_ 为 $9$,因为该数组有 $6$ 个不同的子段:\n\n你需要确定数组 $[a]$ 的 _不平衡值_。\n\n第一行包含一个整数 $n$ ($1 ≤ n ≤ 10^6...",
"is_translate": true,
"language": "Chinese"
},
{
"statement_type": "Markdown",
"content": "**Definitions** \nLet $ n \\in \\mathbb{Z}^+ $ be the length of the array. \nLet $ A = (a_1, a_2, \\dots, a_n) $ be a sequence of integers with $ a_i \\in \\mathbb{Z}^+ $.\n\nLet $ \\mathcal{S} = \\{ [i,j] \\mi...",
"is_translate": false,
"language": "Formal"
}
]
}