3 3 1 2 3 1 2 1 1 3 6 2 3 2
4 9 Consider the paths from vertex $1$ to vertex $2$. The weight of the path $1 \to 2$ is $A_1 + B_1 + A_2 = 1 + 1 + 2 = 4$, and the weight of the path $1 \to 3 \to 2$ is $A_1 + B_2 + A_3 + B_3 + A_2 = 1 + 6 + 3 + 2 + 2 = 14$. The minimum weight is $4$. Consider the paths from vertex $1$ to vertex $3$. The weight of the path $1 \to 3$ is $A_1 + B_2 + A_3 = 1 + 6 + 3 = 10$, and the weight of the path $1 \to 2 \to 3$ is $A_1 + B_1 + A_2 + B_3 + A_3 = 1 + 1 + 2 + 2 + 3 = 9$. The minimum weight is $9$.
2 1 0 1 1 2 3
4
5 8 928448202 994752369 906965437 942744902 907560126 2 5 975090662 1 2 908843627 1 5 969061140 3 4 964249326 2 3 957690728 2 4 942986477 4 5 948404113 1 3 988716403
2832044198 2824130042 4696218483 2805069468 Note that the answers may not fit in a 32-bit integer.
{
"problem": {
"name": "Shortest Path 3",
"description": {
"content": "You are given a simple connected undirected graph with $N$ vertices and $M$ edges. Each vertex $i\\,(1\\leq i \\leq N)$ has a weight $A_i$. Each edge $j\\,(1\\leq j \\leq M)$ connects vertices $U_j$ and $V_",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc362_d"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given a simple connected undirected graph with $N$ vertices and $M$ edges. Each vertex $i\\,(1\\leq i \\leq N)$ has a weight $A_i$. Each edge $j\\,(1\\leq j \\leq M)$ connects vertices $U_j$ and $V_...",
"is_translate": false,
"language": "English"
}
]
}