Problem L. Problem L. Graph Theory Homework
时间限制 1000 ms
内存限制 256 MB
There is a complete graph containing $n$ vertices, the weight of the $i$-th vertex is $w_i$.
The length of edge between vertex $i$ and $j$ $(i \neq j)$ is $\lfloor \sqrt{|w_i - w_j|} \rfloor$.
Calculate the length of the shortest path from $1$ to $n$.
输入数据
输出数据
For each test case, print an integer denoting the length of the shortest path from $1$ to $n$.
样例输入
样例输出
$ Mathjax font initiator $