Codeforces and Polygon may be unavailable from May 23, 4:00 (UTC) to May 23, 7:00 (UTC) due to technical maintenance. ×

Algorithm ideas for a problem

Revision en1, by prakhar897, 2018-12-08 21:24:19

There are n cities in a circle and distance between every adjacent pair of cities was given. We were asked to determine a pair of cities such that the minimum distance to travel between them is maximum.

For example,the input may be: 8 12 16 10 3 13.

We can definitely solve this in O(n2) complexity.Can we improve the complexity any further?how?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English prakhar897 2018-12-08 21:24:19 380 Initial revision (published)