API Response (JSON)
{
"problem": {
"name": "F. Imbalance Value of a Tree",
"description": {
"content": "You are given a tree _T_ consisting of _n_ vertices. A number is written on each vertex; the number written on vertex _i_ is _a__i_. Let's denote the function _I_(_x_, _y_) as the difference between m",
"description_type": "Markdown"
},
"platform": "Codeforces",
"limit": {
"time_limit": 4000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "CF915F"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given a tree _T_ consisting of _n_ vertices. A number is written on each vertex; the number written on vertex _i_ is _a__i_. Let's denote the function _I_(_x_, _y_) as the difference between m...",
"is_translate": false,
"language": "English"
},
{
"statement_type": "Markdown",
"content": "给定一棵包含 $n$ 个顶点的树 $T$。每个顶点上写有一个数字,顶点 $i$ 上的数字为 $a_i$。定义函数 $I(x, y)$ 为连接顶点 $x$ 和 $y$ 的简单路径上所有 $a_i$ 的最大值与最小值之差。\n\n你的任务是计算 。\n\n第一行包含一个整数 $n$ ($1 ≤ n ≤ 10^6$) —— 树的顶点数。\n\n第二行包含 $n$ 个整数 $a_1$, $a_2$, ..., $a_...",
"is_translate": true,
"language": "Chinese"
},
{
"statement_type": "Markdown",
"content": "Let $ T = (V, E) $ be a tree with $ |V| = n $, and let $ a_i \\in \\mathbb{Z} $ be the value assigned to vertex $ i \\in V $.\n\nDefine the function $ I(x, y) = \\max_{v \\in P_{x,y}} a_v - \\min_{v \\in P_{x,...",
"is_translate": false,
"language": "Formal"
}
]
}