Time Limit: 2 sec / Memory Limit: 1024 MB Problem StatementThere are N cities on a number line. The i-th city is located at coordinate xi. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:
Find the maximum value of D that enables you to visit all the cities. Here, to visit a city is to travel to the coordinate where that city is located. Constraints
In |
C++ Skip | AtCoder
最新推荐文章于 2025-03-13 22:29:22 发布