LoginSignup
0
0

More than 1 year has passed since last update.

ABC160 C - Traveling Salesman around Lake から学んだ

Posted at

abc160c_1.png
abc160c_2.png

わからん。解答 please

なるほど。以下でどうでしょう。。

abc160c.py
K,N = map(int,input().split())
A = list(map(int,input().split()))

X = A[0]
lis = []
for i in range(1,N):
    lis.append(A[i]-X)
    X = A[i]
lis.append(K+A[0]-A[N-1])
#print(lis)
print(sum(lis)-max(lis))

できた。

0
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0