1046 最短距离 (20 分) 使用循环队列计算最短距离
发布时间
阅读量:
阅读量
题目
The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of exits.
Input Specification:
Each input file contains one test case. For each case, the first line contains an integer N (N\in [3,10^5]), followed by N integer distances D_1,D_2,⋯ ,D_N, where D_i is the distance between the i-th and the (i+1)-st exits, and D_N is between the N_{th}and the 1st exits. All the numbers in a line are separated by a space. The second line gives a positive integer M(≤10^4), with M lines f
全部评论 (0)
还没有任何评论哟~
