-Code
t = int(input())
distance = [list(map(int, input().split()))]
result = 0
for _ in range(t - 1):
x, y = map(int, input().split())
result += abs(distance[-1][0] - x) + abs(distance[-1][1] - y)
distance.append([x, y])
print(result)
'Beakjoon&프로그래머스 > 파이썬' 카테고리의 다른 글
[백준/파이썬] 16175번 General Election (0) | 2022.11.04 |
---|---|
[백준/파이썬] 21197번 Stopwatch (0) | 2022.11.03 |
[백준/파이썬] 9306번 Practice: Roll Call (0) | 2022.11.01 |
[백준/파이썬] 17548번 Greetings! (0) | 2022.10.31 |
[백준/파이썬] 3578번 Holes (0) | 2022.10.30 |