Problem:


Score : 200 points

Problem Statement

It is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts.

There are N houses along TopCoDeer street. The i-th house is located at coordinate a_i. He has decided to deliver gifts to all these houses.

Find the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions.  

Constraints

1 ≤ N ≤ 100

0 ≤ a_i ≤ 1000

a_i is an integer.

Input

Input is given from Standard Input in the following format:

N
a_1 a_2 ... a_N

Output

Print the minimum distance to be traveled.  

Sample Input 1

4
2 3 7 9

Sample Output 1

7

The travel distance of 7 can be achieved by starting at coordinate 9 and traveling straight to coordinate 2.

It is not possible to do with a travel distance of less than 7, and thus 7 is the minimum distance to be traveled.  

Sample Input 2

8
3 1 4 1 5 9 2 6

Sample Output 2

8

There may be more than one house at a position.  



Sample input:
4
2 3 7 9


Sample output:
7

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
b = [0]*9
for a in A:
    if a <400:
        b[0] += 1
    elif a < 800:
        b[1] += 1
    elif a < 1200:
        b[2] += 1
    elif a < 1600:
        b[3] += 1
    elif a < 2000:
        b[4] += 1
    elif a < 2400:
        b[5] += 1
    elif a < 2800:
        b[6] += 1
    elif a < 3200:
        b[7] += 1
    else:
        b[8] += 1
ans = 8
for B in b[:8]:
    if B == 0:
        ans -= 1
ans2 = ans+b[8]
print(ans,ans2)

Submission status: Wrong Answer

Solution code:
s=int(input())
a=list(map(int,input().split()))
a.sort
print(abs(a[0]-a[len(a)-1]))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
a = list(map(int, input().split()))
a.sort()
print(a[-1]-a[0])

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
a = list(map(int, input().split()))
print(max(a)-min(a))

Submission status: Wrong Answer

Solution code:
a = list(sorted(map(int, input().split())))
print(a[-1] - a[0])

Submission status: Wrong Answer

Solution code:
n = int(input())
s = list(map(int, input().split()))
print(s)
print(max(s) - min(s))

Submission status: Wrong Answer

Solution code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
MOD = 10**9 + 7

n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in a:
    cost = 0
    for j in a:
        d = abs(i-j)
        cost += d
    ans = max(ans,cost)
print(ans)

Submission status: Wrong Answer

Solution code:
A=list(map(int,input().split()))
A=sorted(A)
print(A[-1]-A[0])

Submission status: Wrong Answer

Solution code:
N = int(input())
List = list(map(int,input().split()))
sorted(List)
print(List[-1]-List[0])

Submission status: Wrong Answer

Solution code:
import numpy as np
rate = [400 * i for i in range(0, 10)]

n = int(input())
a = list(map(int, input().split()))

cnt = np.array([0] * (9))
for i in range(n):
  for j in range(9):
    if rate[j] <= a[i] and a[i] < rate[j+1]:
      cnt[j] += 1

orig = (cnt[:8] > 0).sum()
mins = 1 if  orig == 0 and cnt[-1] != 0 else orig
maxs = max(7,orig + cnt[-1])
print(mins, maxs)

Submission status: Wrong Answer

Solution code:
a = sorted((map(int,input().split())))
print(a[-1] - a[0])

Submission status: Wrong Answer

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))
n = ii()
A = list(set(sorted(iil())))
print(A[-1]-A[0])

Submission status: Wrong Answer

Solution code:
# %%
n = int(input())
a = list(map(int, input().split()))
new = sorted(a)
print(a[-1] - a[0])

Submission status: Wrong Answer

Solution code:
n = int(input())
A = [int(_) for _ in range(n)]
print(max(A) - min(A))

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int,input().split()))
sorted(A)
print(A[n-1] - A[0])

Submission status: Wrong Answer

Solution code:
n = int(input())
List = list(map(int,input().split()))
print(List[n-1]-List[0])

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
a.sort
print(a[len(a)-1]-a[0])

Submission status: Wrong Answer

Solution code:
N = list(map(int, input().split()))
print(max(N)-min(N))

Submission status: Wrong Answer

Solution code:
N=int(input())
A_list=list(map(int,input().split()))
print(A_list[N-1]-A_list[0])

Submission status: Wrong Answer

Solution code:
l=sorted(map(int,input().split()))
print(l[-1]-l[0])

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(set(map(int, input().split())))

ans = 0

for a_i in range(1, len(A)):
  ans += A[a_i]-A[a_i-1]
  
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

a = map(int, input().split(" "))

sorted = sorted(a)

sum = 0
prev = -1
for p in sorted:
    if prev > 0:
        sum += p - prev

    prev = p

print(sum)

Submission status: Wrong Answer

Solution code:
N = input()
A = sorted(list(map(int, input().split())))
print(A[-1] - A[0] + 1)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
sa=sorted(a,reverse=True)
total=0
for i in range(1,n):
    total += a[i]-a[i-1]

print(total)

Submission status: Wrong Answer

Solution code:
l = sorted(map(int, input().split()))
print(l[-1] - l[0])

Submission status: Wrong Answer

Solution code:
s = list(map(int,input().split()))
s.sort()
print(s[len(s)-1] - s[0])

Submission status: Wrong Answer

Solution code:
lst = [int(i) for i in input().split()]

print(max(lst) - min(lst))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
mi,ma = 100000,0
for i in a:
	mi = min(mi,i)
	ma = max(ma,i)
print(ma,mi)

Submission status: Wrong Answer

Solution code:
s = list(map(int, input().split()))
print(max(s)-min(s))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
from statistics import median
N = int(input())
A = list(map(int, input().split()))
A.sort()
ans = A[0]
top = -1
for i in range(N-1):
    ans += A[i+1] - A[i]
    top = max([top, A[i+1] - A[i], (A[i+1] - A[i])*2])
print(ans - top//4)

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
print(max(a) - min(a))

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
b=sorted(a)
print(b[-1]-b[0])

Submission status: Wrong Answer

Solution code:
n = int(input())
x = sorted(list(map(int, input().split())))

print(max(x)-min(x)+1)

Submission status: Wrong Answer

Solution code:
*a,=map(int,open(0).read().split());print(max(a)-min(a))

Submission status: Wrong Answer

Solution code:
print((lambda a:max(a)-min(a))(list(map(int,input().split()))))

Submission status: Wrong Answer

Solution code:
s=list(map(int,input().split()))
print(max(s)-min(s))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
res = 0
for i in range(n - 1):
    res += a[i+1] - a[i]
print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(set(map(int, input().split())))
res = 0
for i in range(len(a) - 1):
    res += a[i+1] - a[i]

print(res)

Submission status: Wrong Answer

Solution code:
l=[int(i) for i in input().split()]
print(max(l)-min(l))

Submission status: Wrong Answer

Solution code:
input();a=sorted(input().split());eval(a[-1]+'-'+a[0])

Submission status: Wrong Answer

Solution code:
list = [0]
n = int(input())
list *= n
max = 0
min = 1000
for i in range(n):
    if list[i]<min:
        min = list[i]
    if max<list[i]:
        max = list[i]
print(max-min)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    N = input()
    a = [int(i) for i in input().split()]

    max_a = 0
    min_a = 100
    for buf_a in a:
        if buf_a > max_a:
            max_a = buf_a

        if buf_a < min_a:
            min_a = buf_a

    print(max_a-min_a)

Submission status: Wrong Answer

Solution code:
num = int(raw_input())
law = raw_input().split(" ")
tmp = 1
raw = []
for i in law:
    raw.append(int(i))
for i in range(num):
    for j in range(i, num):
        div = abs(raw[i] - raw[j])
        if div >= tmp:
            tmp = div
print tmp

Submission status: Wrong Answer

Solution code:
num = int(raw_input())
law = raw_input().split(" ")
tmp = 1
raw = []
for i in law:
    raw.append(int(i))
print(raw)
for i in range(num):
    for j in range(i, num):
        div = abs(raw[i] - raw[j])
        if div >= tmp:
            tmp = div
print tmp

Submission status: Wrong Answer

Solution code:
l = list(map(int,input().split()))

l_max = max(l)
l_min = min(l)

print(str(l_max - l_min))

Submission status: Wrong Answer

Solution code:
a=map(int,raw_input().split())
print max(a)-min(a)

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
print(max(a) - min(a))

Submission status: Wrong Answer

Solution code:
x=input().split()
maxX=max(x)
minX=min(x)
print(int(maxX)-int(minX))

Submission status: Wrong Answer

Solution code:
n = int(input())
houses = [int(x) for x in input().split()]
houses.sort()
t = []
ans = 0
for i in range(1,n):
    t.append(houses[i])
    if houses.count(houses[i]) >= 2:
        pass
    else:
        ans += houses[i] - houses[i-1]
        ans = abs(ans)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(int(i) for i in input().split())

a.sort

print(a[n-1] - a[0])

Submission status: Wrong Answer

Solution code:
r = sorted(input().split())
max_i= int(r[len(r)-1])
min_i= int(r[0])
print(max_i - min_i)

Submission status: Wrong Answer

Solution code:
a= input().split(' ')
a = [int(x) for x in a]
mi = min(a)
ma = max(a)
print(int(ma- mi))

Submission status: Accepted

Solution code:
# クリスマスもあと半年となり、トナカイのAtCoDeer君はプレゼントを配る計画を立てることにしました。
# TopCoDeer通りにはN個の家が並んでいます。i個目の家は座標aiにあります。彼はこのすべての家にプレゼントを配ることにしました。
# 好きな場所から開始し好きな場所で終了することができる時、最小の移動距離を求めなさい。

N = int(input())
a = list(map(int,input().split()))

print(max(a) - min(a))

Submission status: Accepted

Solution code:
n = int(input())
houses = list(map(int, input().split()))
print(max(houses)-min(houses))

Submission status: Accepted

Solution code:
n = int(input())
a = sorted(list(map(int, input().split())))
print(a[-1]-a[0])

Submission status: Accepted

Solution code:
# listを並び替えて移動距離の最小値を求める

N = int(input())
a = list(map(int, input().split()))

# 降順に並び替える
descending_a = sorted(a, reverse=True)
# print(descending_a)

# 座標の最大値から最小値を引く→移動距離を求める
print(descending_a[0] - descending_a[-1])

Submission status: Accepted

Solution code:
def minimum_dist(l1: list) -> int:
    return max(l1) - min(l1)


if __name__ == "__main__":
    n = int(input())
    list_coordinate = list(map(int, input().split()))
    print(minimum_dist(list_coordinate))

Submission status: Accepted

Solution code:
# 最小の移動距離は、一番端から反対側まで一直線に移動する事。
# 行ったり来たりする可能性はない
n = int(input())
a = list(map(int, input().split()))
# 座標は正の整数のみなのでmax-minで計算できそう。
# print(mix-min)
print(max(a)-min(a))

Submission status: Accepted

Solution code:
N = int(input())
N_List = list(map(int,input().split()))
print(max(N_List)-min(N_List))

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int, input().split()))

print(max(A)-min(A))

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))

print(max(a) - min(a))

Submission status: Accepted

Solution code:
N = map(int, input().split())
point = list(map(int,input().split()))

max = 0
min = 1000

for i in range(len(point)):
    if max < point[i]:
        max = point[i]
    if min > point[i]:
        min = point[i]
print(max - min)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]

print(max(a) - min(a))

Submission status: Accepted

Solution code:
N = input()
data = list(map(int, input().split()))

max = max(data)
min = min(data)

print(max - min)

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
a.sort()
print(a[len(a)-1] - a[0])

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int,input().split()))

print(max(a) - min(a))

Submission status: Accepted

Solution code:
N = int(input())
a = sorted(set(list(map(int, input().split()))))
print(a[-1]- a[0])

Submission status: Accepted

Solution code:

n=input()
a=list(map(int, input().split()))

a1=max(a)
a2=min(a)

print(a1-a2)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))

print(max(a)-min(a))

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
print(max(a)-min(a))

Submission status: Accepted

Solution code:
input()
a = list(map(int,input().split()))
print(max(a)-min(a))

Submission status: Accepted

Solution code:
N = input()
a = list(map(int, input().split()))

print(max(a) - min(a))

Submission status: Accepted

Solution code:
N = int(input())
lst = input().split()

for i in range(N):
   lst[i] = int(lst[i])

print(max(lst) - min(lst))

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
print(a[-1] - a[0])

Submission status: Accepted

Solution code:
N=int(input())
a=list(map(int,input().split()))
print(max(a)-min(a))

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = a[-1] - a[0]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))

print(max(a) - min(a))

Submission status: Accepted

Solution code:
#https://atcoder.jp/contests/abc064/tasks/abc064_b
S_list = [input() for i in range(2)]
N = map(int,S_list[0].split())    
A_list = list(map(int,S_list[1].split()))

print(max(A_list)-min(A_list))

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
a.sort()
print(a[N - 1] - a[0])

Submission status: Accepted

Solution code:
n = int(input())
a = [int(s) for s in input().split()]

print(max(a) - min(a))

Submission status: Accepted

Solution code:
N=input()
a=list(map(int,input().split()))
a.sort()
print(a[-1]-a[0])

Submission status: Accepted

Solution code:
n = input()
data = list(map(int,input().split()))
data.sort(reverse = True)
ans = 0
for i in range(len(data) - 1):
    ans += data[i] - data[i + 1]
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
L=list(map(int,input().split()))
print(max(L)-min(L))

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = max(A) - min(A)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int,input().split()))
a.sort()

distance = 0

for i in range(N - 1):
    distance += a[i + 1] - a[i]

print(distance)

Submission status: Accepted

Solution code:
N = int(input())
home = list(map(int,input().split()))

print((max(home))-(min(home)))

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int, input().split()))
A=sorted(A)
print(A[-1]-A[0])

Submission status: Accepted

Solution code:
n = int(input())
x = list(map(int,input().split()))
print(max(x)-min(x))

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    a = list(map(int,input().split()))
    a.sort()
    ans = 0
    #print(a)
    for i in range(1,N,1):
        ans += a[i] - a[i-1]

    return ans

print(main())

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int, input().split()))

print(max(A)-min(A))

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
A.sort()
print(A[N-1] - A[0])

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
ans = max(A)-min(A)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = sorted(list(map(int,input().split())))
print(A[N-1]-A[0])

Submission status: Accepted

Solution code:
from sys import stdin
rs = lambda : stdin.readline().strip()
ri = lambda : int(rs())
ril = lambda : list(map(int, rs().split()))

def main():
    N = ri()
    a = ril()
    print(max(a) - min(a))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
arr = list(map(int, input().split()))

print(max(arr) - min(arr))

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
a.sort()
print(a[-1]-a[0])

Submission status: Accepted

Solution code:
N = input()
x = list(map(int,input().split()))

print(max(x) - min(x))

Submission status: Accepted

Solution code:

N = int(input())
a = list(map(int,input().split()))

print(max(a)-min(a))

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
print(max(A)-min(A))

Submission status: Accepted

Solution code:
total_house = int(input())
house_coordinate = sorted(list(map(int, input().split())))
print(house_coordinate[total_house - 1] - house_coordinate[0])

Submission status: Accepted

Solution code:
total_house = int(input())
house_coordinate = sorted(list(map(int, input().split())))
print(house_coordinate[total_house - 1]- house_coordinate[0])

Submission status: Accepted

Solution code:
N = input()
a = list(map(int, input().split()))
print(max(a)-min(a))

Submission status: Accepted

Solution code:
# B - Traveling AtCoDeer Problem
def main():
    _ = int(input())
    a = list(map(int, input().split()))

    print(max(a)-min(a))



if __name__ ==  "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
A =list(map(int, input().split()))

MAX = max(A)
MIN = min(A)

print(MAX-MIN)

Submission status: Accepted

Solution code:
n = input()
list01 = input().split()
list02 = [int(a) for a in list01]

print(max(list02) - min(list02))

Submission status: Accepted

Solution code:
N = int(input())
a = sorted([int(x) for x in input().split()])

print(max(a) - min(a))

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
print(max(a) - min(a))

Submission status: Accepted

Solution code:
home_num = int(input())
house_from = list(map(int,input().split()))

print(max(set(house_from)) - min(set(house_from)))

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))

A.sort()

print(A[-1] - A[0] if N > 1 else 0)

Submission status: Accepted

Solution code:
N=int(input())
A=[int(x) for x in input().split()]
print(max(A)-min(A))

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
a.sort()

distance = 0

for i in range(N - 1):
    distance += a[i + 1] - a[i]

print(distance)

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int,input().split()))

distance = max(a)-min(a)

print(distance)

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))

# 一番離れている座標の差
print(max(a) - min(a))

Submission status: Accepted

Solution code:
# B - Traveling AtCoDeer Problem

# N
N = int(input())
my_list = list(map(int, input().split(maxsplit=N)))

my_list_sort = sorted(my_list)
answer = my_list_sort[-1] - my_list_sort[0]

print(answer)

Submission status: Accepted

Solution code:
N=input()
Ni=list(map(int,input().split()))

print(max(Ni)-min(Ni))

Submission status: Accepted

Solution code:
#ABC064B
n = int(input())
a = sorted(list(map(int,input().split())))
ans = 0 
for i in range(n-1):
    ans += a[i+1]-a[i]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
points = list(map(int, input().split()))

result = max(points) - min(points)
print(result)

Submission status: Accepted

Solution code:
n = int(input())
street = sorted(list(map(int, input().split())))
print(street[-1]-street[0])

Submission status: Accepted

Solution code:
N = int(input())
house = list(map(int, input().split()))

# プレゼントを届けるための、最大値から最小値を引いて、最小の移動距離を出力

print(max(house)-min(house))

Submission status: Accepted

Solution code:
n = int(input())
coordinates = list(map(int, input().split()))

print(max(coordinates) - min((coordinates)))

Submission status: Accepted

Solution code:
# 数値の取得
homecnt = int(input())
homeplace = list(map(int,input().split()))

# 最短距離を計算し出力
dist = max(homeplace) - min(homeplace)
print(dist)

Submission status: Accepted

Solution code:
N=int(input())
a=list(map(int,input().split()))
print(max(a)-min(a))

Submission status: Accepted

Solution code:
N=int(input())
a=str(input())

def ans064(N:int, a:str):
    a_list=sorted(map(int,a.split()))
    return(a_list[-1]-a_list[0])

print(ans064(N,a))

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int,input().split()))
print(max(a)-min(a))

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
print(max(A) - min(A))

Submission status: Accepted

Solution code:
n=input()
a=list(map(int, input().split()))

def answer(n:int, a:list)->int:
    return max(a)-min(a)

print(answer(n,a))

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
# リストの最大値から最小値を引いて出力
print(max(a)-min(a))

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
print(max(a)-min(a))

Submission status: Accepted

Solution code:
input()
a = list(map(int,input().split()))
a.sort()
print(a[-1]-a[0])

Submission status: Accepted

Solution code:
num_house = int(input())
a = map(int, input().split())
house_list = list(a)

print(max(house_list) - min(house_list))

Submission status: Accepted

Solution code:
N=int(input())
a = list(map(int,input().split()))
print(max(a)-min(a))

Submission status: Accepted

Solution code:
def answer(n: int, a: []) -> int:
    return max(a) - min(a)


def main():
    n = int(input())
    a = list(map(int, input().split()))
    print(answer(n, a))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
a = [ int(v) for v in input().split(" ") ]

max_v = max(a)
min_v = min(a)

print(max_v - min_v)

Submission status: Accepted

Solution code:
import sys
# sys.setrecursionlimit(100000)


def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    n = input_int()
    A = input_int_list()
    print(max(A) - min(A))
    return


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a = int(input())
lis = list(map(int,input().split()))
print(max(lis)-min(lis))

Submission status: Accepted

Solution code:
with open(0) as f:
    N, *a = map(int, f.read().split())
print(max(a)-min(a))

Submission status: Accepted

Solution code:
def atc_064b(input_value: str) -> str:
    N = input_value[0]
    ai = [int(i) for i in input_value[1].split(" ")]
    return max(ai) - min(ai)

N = input()
ai = input()
print(atc_064b([N, ai]))

Submission status: Accepted

Solution code:
n = input()
a = list(map(int, input().split()))
print(max(a) - min(a))

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    a_list = list(map(int, input().split()))

    print(max(a_list) - min(a_list))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
x = max(A)
y = min(A)
print(x - y)

Submission status: Accepted

Solution code:
n = int(input())
li = list(map(int, input().split()))
print(max(li)-min(li))

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
a.sort()
print(a[n-1]-a[0])

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
print(max(a)-min(a))

Submission status: Accepted

Solution code:
# B - Traveling AtCoDeer Problem
# https://atcoder.jp/contests/abc064/tasks/abc064_b

N = int(input())
a = list(map(int, input().split()))
print(max(a) - min(a))

Submission status: Accepted

Solution code:
N = int(input())
ary = sorted(list(map(int, input().split())))
print(ary[-1] - ary[0])

Submission status: Accepted

Solution code:
n = int(input())
A = [int(m) for m in input().split()]
print(max(A)-min(A))

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
b = list(map(int,input().split()))

b.sort()
print(b[-1]-b[0])

Submission status: Accepted

Solution code:
n=int(input())
s=list(map(int,input().split()))
print(max(s)-min(s))

Submission status: Accepted

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
print(max(a)-min(a))

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
print(max(a) - min(a))

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))


a = set(a)
a = list(a)
a = sorted(a)

SUM = 0
for i in range(len(a)-1):
    SUM = SUM + (a[i+1]-a[i])
print(SUM)

Submission status: Accepted

Solution code:
n=int(input())
a = list(map(int,input().split()))
print(max(a)-min(a))

Submission status: Accepted

Solution code:
n = int(input())
list_a = sorted((int(n) for n in input().split()))
print(list_a[-1] - list_a[0])

Submission status: Accepted

Solution code:
n = int(input())
li = list(map(int, input().split()))
print(max(li) - min(li))

Submission status: Accepted

Solution code:
n = int(input())
#n, k = map(int, input().split())
al = list(map(int, input().split()))
#al=[list(input()) for i in range(n)]

print(max(al)-min(al))

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    a = list(map(int, input().split()))
    print(max(a) - min(a))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
print(max(l)-min(l))

Submission status: Accepted

Solution code:
n = input()
a = list(map(int, input().split()))
print(max(a)-min(a))

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())
    a = list(map(int, readline().split()))
    a.sort()

    print(a[-1] - a[0])


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
print(max(A)-min(A))

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))

ans  = max(a) -min(a)
print(ans)

Submission status: Accepted

Solution code:
from typing import List


N: int = int(input())
A = list(map(int, input().split()))  # type: List[int]

print(max(A) - min(A))

Submission status: Accepted

Solution code:

N = int(input())
a = list(map(int, input().split()))
print(max(a)-min(a))

Submission status: Accepted

Solution code:
#
# abc064 b
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """4
2 3 7 9"""
        output = """7"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """8
3 1 4 1 5 9 2 6"""
        output = """8"""
        self.assertIO(input, output)


def resolve():
    N = int(input())
    a = list(map(int, input().split()))

    a.sort()
    print(a[-1]-a[0])


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Accepted

Solution code:
# coding: utf-8

num = int(input())
str = input().split()
table = [int(i) for i in str]
list.sort(table)
print(table[num-1] - table[0])

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
print(max(a)-min(a))

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
print(max(a)-min(a))

Submission status: Accepted

Solution code:
a=input()
a=int(a)
b=list(map(int,input().split()))
b.sort()
print(b[a-1]-b[0])

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
a.sort()

print(a[-1] - a[0])

Submission status: Accepted

Solution code:
N=int(input())
A = list(map(int, input().split()))

distance=max(A)-min(A)
print(distance)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
a = sorted(a)
print(a[-1]-a[0])

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
print(a[len(a) - 1] - a[0])

Submission status: Accepted

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    n = i_input()
    num_list = i_list()

    num_list.sort()

    print(num_list[n-1] - num_list[0])

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
input();a=sorted(map(int,input().split()));print(a[-1]-a[0])

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
l.sort()
c=0
for i in range(1,n):
    c+=l[i]-l[i-1]
print(c)

Submission status: Accepted

Solution code:
N=int(input())
a=list(map(int,input().split()))
a.sort()
print(abs(a[len(a)-1]-a[0]))

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = a[-1]-a[0]
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
print(max(A)-min(A))

Submission status: Accepted

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
print(max(a) -min(a))

Submission status: Accepted

Solution code:
N = int(input())
a = sorted(list(map(int, input().split())))
print(a[-1]-a[0])

Submission status: Accepted

Solution code:
n = int (input ())
l = [int (x) for x in input().split()]
ma = max (l)
mi = min (l)
print (ma - mi)

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))

print(max(l) - min(l))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
N = int(input())
a = sorted(list(map(int, input().split())))

print(a[-1] - a[0])

Submission status: Accepted

Solution code:
N = int(input())
A = sorted(map(int, input().split()))
print(A[N-1] - A[0])

Submission status: Accepted

Solution code:
n = int(input())
points = list(map(int, input().split()))

points.sort()
start = points[0]
cnt = 0
for i in points:
    cnt += i -start
    start = i

print(cnt)