TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
A = []

N = int(input())*N

for i in range(0, N) :
    a = int(input())
    A.append(a)
    

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

A = []

N = int(input())

for i in range(0, N) :
    a = int(input())
    A.append(a)
    

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

A = []

N = int(input())
if N in range(1,100) :
    for i in range(1, N+1) :
        a = int(input())
        if a in range(1,int(10e8)) :
            A.append(a)
    
ma = max(A)
mi = min(A)

print(ma - mi)

N = int(input())
A = []
for i in range(1, N+1) :
    a = int(input())
    A.append(a)
print(A)

ma = max(A)
mi = min(A)

print(ma - mi)

N = int(input())
A = []
for i in range(1, N+1) :
    a = int(input())
    A.append(a)

ma = max(A)
mi = min(A)

print(ma - mi)

n = int(input())
A = input().split()
for i in range(len(A)) :
    A[i] = int(A[i])
print(max(A)-min(A))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n = int(input())
a = [int(i) for i in input().split()]
b = []
for i in range(n):
    b.append(abs(int(a[i-1]) - int(a[i])))
print(max(b))

n = int(input())
a = [int(i) for i in input().split()]
print(max(a) - min(a))

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):


import sys
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline().rstrip())
lis = list(map(int, readline().rstrip().split()))
sorted(lis)

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




import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, *A = map(int, read().split())
A.sort()
print(A[-1]-A[0])


Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())
a = list(map(int, input().split())).sort()
print(a[-1] - a[0])

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

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n = int(input())
a = [int(input()) for i in range(n)]
a.sort()
print(a[-1] - a[0])

n = int(input())
a = [int(input()) for i in range(n)]
a.sort()
print(a[-1] - a[0])

n = int(input())
a = [int(input()) for i in range(n)]
a.sort()
print(a[-1] - a[0])

n = int(input())
a = [int(i) for i in input().split()]
a.sort()
print(a[-1] - a[0])

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n=int(input())
a=list(map(int,input().split()))
a.sort()
print(a[n-1]=a[0])

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

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
_ = input()
a = sorted(map(int, input().split()))
print(a[0]-a[-1])

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

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
def B():
    n = int(input())
    a = input().split()
    
    if(len(a) != n):
        exit(1)

    i_max = 0
    i_min = 1000000001
    for i in a:
        k = int(i)
        if (i_max < k):
                i_max = k
        if (i_min > k):
                i_min = k
    print(i_max,i_min)
    print(abs( i_max - i_min))

if __name__ =='__main__':
    B()

def B():
    n = int(input())
    a = input().split()
    
    if(len(a) != n):
        exit(1)

    i_max = 0
    i_min = 1000000001
    for i in a:
        k = int(i)
        if (i_max < k):
                i_max = k
        if (i_min > k):
                i_min = k
    print(i_max,i_min)
    print(abs( i_max - i_min))

if __name__ =='__main__':
    B()


def B():
    n = int(input())
    a = input().split()
    
    if(len(a) != n):
        exit(1)

    i_max = 0
    i_min = 1000000001
    for i in a:
        k = int(i)
        if (i_max < k):
                i_max = k
        if (i_min > k):
                i_min = k
    print(abs( i_max - i_min))

if __name__ =='__main__':
    B()

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
import sys
n = int(input())
a = list(map(int, input().split())).sorted()
print(a[n-1] - a[0])

import sys
n = int(input())
a = list(map(int, input().split()))
a.sort()
print(a[n-1] - a[0])

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n=int(input())
lst=[int(input()) for i in range(n)]
print(max(lst)-min(lst))

n=int(input())
lst=list(map(int,input().split()))
print(max(lst)-min(lst))

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N=input()
a=list(map(int,input().split()))
mini=maxi=a[0]
for i in range(1,N):
  mini=min(mini,a[i])
  maxi=max(maxi,a[i])
print(maxi-mini)

N=int(input())
a=list(map(int,input().split()))
mini=maxi=a[0]
for i in range(1,N):
  mini=min(mini,a[i])
  maxi=max(maxi,a[i])
print(maxi-mini)

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())
A = tuple(map(int, input().split()))
print(max(A) - min(A)

N = int(input())
A = tuple(map(int, input().split()))
print(max(A) - min(A))

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
from sys import stdin
data=[int(x) for x in stdin.readline().rstrip().split()]
data=sorted(data)
print(abs(data[0]-data[-1]))

from sys import stdin
data=[int(x) for x in stdin.readline().rstrip().split()]
data=sorted(data)
print(abs(data[0]-data[-1])

from sys import stdin
N=int(stdin.readline().rstrip())
data=[int(x) for x in stdin.readline().rstrip().split()]
data=sorted(data)
print(abs(data[0]-data[-1]))

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n = int(input())
ais = list(map(int, input().split()))
a_mini = ais[0]
a_max = ais[0]
for i in rnage(1, n):
  if ais[i] < a_mini:
    a_mini = ais[i]
  if ais[i] > a_max:
    a_max = ais[i]
print(a_max - a_mini)

n = int(input())
ais = list(map(int, input().split()))
a_mini = ais[0]
a_max = ais[0]
for i in range(1, n):
  if ais[i] < a_mini:
    a_mini = ais[i]
  if ais[i] > a_max:
    a_max = ais[i]
print(a_max - a_mini)

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
x = [int(i) for i in input().split()]
seq = x[1:]
print(max(seq)-min(seq))

x = int(input())
seq = [int(i) for i in input().split()]
print(max(seq)-min(seq))

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n = int(input())
a = [int(num) for num in input().split()]
m = 0
for i in range(n):
  for j in range(n):
    m = max(max,abs(a[i]-a[j]))
print(m)

n = int(input())
a = [int(num) for num in input().split()]
m = 0
for i in range(n):
  for j in range(n):
    m = max(m,abs(a[i]-a[j]))
print(m)

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())
A = [int(input()) for i in range(N)]
Amin = min(A)
Amax = max(A)
print(abs(Amax-Amin))

N = int(input())
A = list(map(int, input().split()))
Amin = min(A)
Amax = max(A)
print(abs(Amax-Amin))

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
mport numpy as np
n = int(input())
a = [int(input()) for x in range(n)]
print(np.amax(abs(np.subtract.outer(a, a))))


import numpy as np
n = int(input())
a = [int(x) for x in input()]
print(np.amax(abs(np.subtract.outer(a, a))))


# ABC102B

import numpy as np
n = int(input())
a = [int(x) for x in input().split()]
print(np.amax(abs(np.subtract.outer(a, a))))


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())
a = list(map(int, input().split()))

mx_diff = 0
for i in range(1, N):
    if abs(a[i-1]-a[i]) > mx_diff:
        mx_diff = abs(a[i-1]-a[i])
print(mx_diff)

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

mx_a = 1
mn_a = 10**9
for i in range(N):
    if a[i] > mx_a:
        mx_a = a[i]
    if a[i] < mn_a:
        mn_a = a[i]
print(mx_a-mn_a)


Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n=int(input())
a=[int(input()) for _ in range(n)]
print(max(a)-min(a))


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

n=int(input())
a=[map(int,input().split())]
print(max(a)-min(a))

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
import sys

def solve(n, lst_a):
    a=1
    b=1    
    for i in as1:
        if a <i:
            a=i
        elif b>i:
            b=i
    return a-b

def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    n = int(line1)
    line2 = sys.stdin.readline().rstrip()
    lst_a = [int(s) for s in line2.split(' ')]
    return (n, lst_a)

def main():
    n, lst_ab = readQuestion()
    answer = solve(n, lst_ab)
    print(answer)
    
if __name__ == '__main__':
    main()

import sys

def solve(n, lst_a):
    a=lst_a[0]
    b=lst_a[0]
    [0]
    for i in lst_a:
        if a <i:
            a=i
        elif b>i:
            b=i
    return a-b

def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    n = int(line1)
    line2 = sys.stdin.readline().rstrip()
    lst_a = [int(s) for s in line2.split(' ')]
    return (n, lst_a)

def main():
    n, lst_ab = readQuestion()
    answer = solve(n, lst_ab)
    print(answer)
    
if __name__ == '__main__':
    main()

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
x = sorted(map(int,input().split()))
print(abs(x[-1]-x[0]))

N = int(input())
x = sorted(map(int,input().split()))
print(abs(x[-1]-x[0]))

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())
list =  [int(i) for i in input().split()]
print(list)
print(max(list) - min(list))

N = int(input())
list =  [int(i) for i in input().split()]
print(max(list) - min(list))

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n = int(input())
a = []
for _ in range(n) :
    a += [int(input())]
print(max(a)- min(a))

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

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n = int(input())
a = map(int, input().split())
print(max(a) - min(a))


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


Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())
a = map(int,raw_input().split())

amax = (max(a))
amin = (min(a))

res = abs(amax-amin)
print res 

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

amax = (max(a))
amin = (min(a))

res = abs(amax-amin)
print (res) 

N = int(input())

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

amax = (max(a))
amin = (min(a))

res = abs(amax-amin)
print (res)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())
num_lists = list(map(int, input().split))
ans = 0

for i in num_lists:
  for j in num_lists:
    diff = abs(i - j)
    if diff > ans:
      ans = diff

print(ans)

N = int(input())
num_lists = list(map(int, input().split))
ans = - 1

for i in num_lists:
  for j in num_lists:
    diff = abs(i - j)
    if diff > ans:
      ans = diff

print(ans)

N = int(input())
num_lists = list(map(int, input().split))
max_num = max(num_lists)
min_num = min(num_lists)
ans = max_num - min_num
print(ans)

N = int(input())
num_lists = list(map(int, input().split()))
ans = 0
 
for i in num_lists:
  for j in num_lists:
    diff = abs(i - j)
    if diff > ans:
      ans = diff
print(ans)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
a = int(input())
b = for list(map(int,input().split()))
min = b[0]
max = b[0]
for i in range(a):
    if b[i] < min:min=b[i]
    if b[i] > max:max=b[i]
print(max-min)


a = int(input)
b = map(int,input().split())
min = b[0]
max = b[0]
for i in range(a):
    if b[i] < min:min=b[i]
    if b[i] > max:max=b[i]
print(max-min)

a = int(input())
b = list(map(int,input().split()))
min = b[0]
max = b[0]
for i in range(a):
    if b[i] < min:min=b[i]
    if b[i] > max:max=b[i]
print(max-min)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
l = sorted(list(map(int, input().split())))
ans = l[-1] - l[0]
print(ans)

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



Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(1, n):
    ans = max(abs(a[i] - a[i - 1]), ans)
print(ans)

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

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n=int(input("input N ,")) 
lista=input("input A ,").split() 
p=int(lista[0])
q=int(lista[0])
for i in range(1,n):
    k=int(lista[i])
    if k<=p:
        p=k
    elif k>=q:
        q=k
print(int(q)-int(p))

n=int(input()) 
lista=input().split() 
p=int(lista[0])
q=int(lista[0])
for i in range(1,n):
    k=int(lista[i])
    if k<=p:
        p=k
    elif k>=q:
        q=k
print(int(q-p))

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())
nums = [int(input()) for i in range(N)]

print(max(nums) - min(nums))

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

print(max(nums)-min(nums))

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())
A_list = list(map(int, input().split()))
B_list = [a - (i + 1) for i, a in enumerate(A_list)]
B_list.sort()
b = B_list[len(B_list) / 2]
s = sum([abs(B - b) for B in B_list])
print(s)

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

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n=int(input())
a=list(map(int,input().split()))
ma=max(a)-min(a)
print(ma

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

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = input()
aryA = input().split(" ")

N = int(N)
aryA = [int(s) for s in aryA]
ans = []
for x in range(len(aryA) - 1):
    ans.append(abs(aryA[x+1] - aryA[x]))

print(max(ans))

N = input()
aryA = input().split(" ")

N = int(N)
aryA = [int(s) for s in aryA]
ans = []
for x in range(len(aryA) - 1):
    for y in range(len(aryA)):
        ans.append(abs(aryA[x] - aryA[y]))

print(max(ans))

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())
a = list(map(int, input().split()))
max = 0
for i in range(len(a)+1):
  for j in range(i+1, len(a)):
    print(i, j)
    if max < abs(a[i] - a[j]):
      max = abs(a[i] - a[j])
print(max)

N = int(input())
a = list(map(int, input().split()))
max = 0
for i in range(len(a)+1):
  for j in range(i+1, len(a)):
    #print(i, j)
    if max < abs(a[i] - a[j]):
      max = abs(a[i] - a[j])
print(max)

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n = int(input())
a = list(map(int,input().split()))
b = a.sort()
print(abs(b[0] - b[-1]))

n = int(input())
a = list(map(int,input().split()))
b = list(sorted(a))
print(abs(b[0] - b[-1]))

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())
A = input().split(" ")
B = [int(n) for n in A]

m = 0
M = 0
for b in B:
  if b < m:
    m = b
  
  if b > M:
    M = b

print(M-m)

        N = int(input())
        A = input().split(" ")
        B = [int(n) for n in A]
         
        m = float("inf")
        M = 0
        for b in B:
          if b < m:
            m = b
          
          if b > M:
            M = b
         
        print(M-m)

    N = int(input())
    A = input().split(" ")
    B = [int(n) for n in A]
     
    m = inf
    M = 0
    for b in B:
      if b < m:
        m = b
      
      if b > M:
        M = b
     
    print(M-m)

N = int(input())
A = input().split(" ")
B = [int(n) for n in A]
             
m = float("inf")
M = 0
for b in B:
  if b < m:
    m = b
              
  if b > M:
    M = b
             
print(M-m)

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n = int(input())
a = list(map(int,input().split()))
l = []
for i in range(n+1):
    for j in range(n+1):
        l.append(abs(a[i]-a[j]))
print(max(l))

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

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = list(map(int, input().split()))

print(abs(max(N) - min(N)))

N = list(map(float, input().split()))

print(int(abs(max(N) - min(N))))


_, N = input(), list(map(float, input().split()))

max = 0
min = 10 ** 9

for i in N:
    if max < i:
        max = i
    if min > i:
        min = i

print(int(abs(min - max)))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())
A_list = [int(a) for a in input().split()]
A_list.sort()
print(max([A_list[i+1]-A_list[i] for i in range(N-1)]))

N = int(input())
A_list = [int(a) for a in input().split()]
A_list.sort()
print(A_list[-1]-A_list[0])

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n=int(input())
a = list(map(int,split(input())))
a.sort()
print(abs(a[0]-a[-1]))

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


Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
A = list(map(int, input().split()))

A = sorted(A)
print(A[-1] - A[0])

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

A = sorted(A)
print(A[-1] - A[0])

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())
A = [int(i) for i in input().split()]
sort.A
dif = A[N-1]-A[0]
print(dif)

N = int(input())
A = [int(i) for i in input().split()]
A.sort()
dif = A[N-1]-A[0]
print(dif)


Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())
A = sorted(list(map(int, input().split())))
print(A[N+1]-A[0])

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

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


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n = input()
a = list(map(int,input().split()))

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


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


Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n = int(input())
a = list(map(int , input().split()))
ans = 0
prev = a[0]
for ai in a:
    ans = max(ans, abs(prev - ai))
    prev = ai
print(ans)

n = int(input())
a = list(map(int , input().split()))
ans = 0
for ai in a:
    for bi in a:
        ans = max(ans, abs(bi - ai))
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
input()
numbers = map(int, input().split())
print(max(numbers)-min(numbers))

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


Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N=int(input())
A=list(map(int,input().split()))
A.sort()
print(A[N]-A[0])

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

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())
a = map(int, input().split)

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

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

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

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

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    N = int(lines.pop(0))
    L = list(map(int, lines.pop(0).split(' ')))
    L.sort()
    print(L[-1] - L[0])

#
# main
#

# 1. use list instead of stdin

# contents = '''\
# 4
# 1 4 6 3\
# '''


# 2. use stdin

# lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    N = int(lines.pop(0))
    L = list(map(int, lines.pop(0).split(' ')))
    L.sort()
    print(L[-1] - L[0])

#
# main
#

# 1. use list instead of stdin

# contents = '''\
# 4
# 1 4 6 3\
# '''


# 2. use stdin

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())
A = list(map(intm input().split()))

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

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

min = A[0]
max = A[0]
for i in range(N):
  if A[i] > max:
    max = A[i]
  if A[i] < min:
    min = A[i]
print(max - min)

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
def main():
    N = int(input())
    A = []
    for i in range(N):
        A.append(int(input()))
    
    A.sort()
    print(A[N - 1] - A[0])
    
if __name__ == "__main__":
    main()

def main():
    N = int(input())
    A = []
    for i in range(N):
        A.append(int(input()))
    
    A.sort()
    print(A[n - 1] - A[0])
    
if __name__ == "__main__":
    main()

def main():
    N = int(input())
    A = []
    data = input().split()
    for i in range(N):
        A.append(int(data[i]))
    
    A.sort()
    print(A[N - 1] - A[0])
    
if __name__ == "__main__":
    main()

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
import numpy as np

a = input()
b = []
b = input().split()
ans = 0
for i in a-1:
  for j in a-1:
    c = b[i]-b[j]
    if(ans < np.abs(c):
       ans = c
print(c)

import numpy as np

a = int(input())
b = input().split()
c = []
for i in range(a):
  c.append(int(b[i]))
ans = 0
for i in range(a):
  for j in range(a):
    d = c[i] - c[j]
    d = np.abs(d)
    if(ans < d):
       ans = d
print(ans)

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n=input()
a=list(map(int,input().split()))
print(a.max()-a.min())

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


Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = input()
list = sorted(map(int, input().split()))
print(list[-1] - list[-2])

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

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
p=input;p();a=map(int,p().split());print(max(a)-min(a))

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

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
def main():
    n = int(input())
    nums = input().split()
    print(nums)
    for i in range(len(nums)):
        nums[i] = int(nums[i])
    print(nums)
    max_diff = 0
    for i in range(len(nums)):
        for j in range(i, len(nums)):
            diff = abs(nums[i] - nums[j])
            if diff > max_diff:
                max_diff = diff
    print(max_diff)

main()


def main():
    n = int(input())
    nums = input().split()
    for i in range(len(nums)):
        nums[i] = int(nums[i])
    max_diff = 0
    for i in range(len(nums)):
        for j in range(i, len(nums)):
            diff = abs(nums[i] - nums[j])
            if diff > max_diff:
                max_diff = diff
    print(max_diff)

main()


Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N=int(input())
a=list(map(int,input().split()))
print(a)   
a_max=max(a)
a_min=min(a)
print(a_max-a_min)

N=int(input())
a=[0]*N
for i in range(N):
    a[i]=int(input())
print(a)   
a_max=max(a)
a_min=min(a)
print(a_max-a_min)

N=int(input())
a_list=[int(input()) for i in range(N)]
print(a_list)
    
a_max=max(a_list)
a_min=min(a_list)
print(a_max-a_min)
    

N=int(input())
a_list=[]
for i in range(N):
    a_list.append(int(input()))
    
a_max=max(a_list)
a_min=min(a_list)
print(a_max-a_min)
    

N=int(input())
a_list=map(int,input().split())
    
a_max=max(a_list)
a_min=min(a_list)
print(a_max-a_min)
    

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

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
input()
lst=list(map(int,input().split())).sort()
print(lst[-1]-lst[0])

i=input;i();l=sorted(map(int,i().split()));print(l[-1]-l[0])

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n=int(input()) 
num=list(int,input().split())
ans=0
for i in range(n-1):
  for j in range(i+1,n):
    dif=abs(num[i]-num[j])
    if dif>ans:
      ans=dif
print(ans)

n=int(input()) 
num=list(map(int,input().split()))
ans=0
for i in range(n-1):
  for j in range(i+1,n):
    dif=abs(num[i]-num[j])
    if dif>ans:
      ans=dif
print(ans)


Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n=int(input())

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

max=0
for i in range(n):
    for j in range(n):
        if i!=j:
            abs=abs(a[i]-a[j])
            if max<=abs:
                max=abs


print(max)
    


n=int(input())

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

max=0
for i in range(n):
    for j in range(n):
        if i!=j:
            x=int(a[i]-a[j])
            y=abs(x)
            if max<=y:
                y
                max=y


print(max)
    

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
s = list(map(int, input().split()))
print(ma(s) - min(s))

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

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

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N=input()
A=list(map(int, input().split()))
A.sort()
print(A[N-1]-A[0])

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

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
a = int.input()
l = list(map(int,input().split()))
m = l[0]
M = l[0]
for i in range(1,a):
  if l[i]<m:
    m = l[i]
  if l[i]>M:
    M=l[i]
print(M-m)

a = int.input()
l = list(map(int,input().split()))
m = l[0]
M = l[0]
for i in range(1,a):
  if l[i]<m:
    m = l[i]
  else:
    if l[i]>M:
      M=l[i]
    else:
      pass
  
print(M-m)

a = int.input()
l = list(map(int,input().split()))
m = l[0]
M = l[0]
for i in range(1,a):
  if l[i]<m:
    m = i[i]
  if l[i]>M:
    M=l[i]
print(M-m)

a = int.input()
l = list(map(int,input().split()))
m = l[0]
M = l[0]
for i in range(1,a):
  if l[i]<m:
    m = l[i]
  else:
    if l[i]>M:
      M = l[i]
    else:
      pass
print(M-m)

a = int(input())
l = list(map(int,input().split()))
m = l[0]
M = l[0]
for i in range(1,a):
  if l[i]<m:
    m = l[i]
  else:
    if l[i]>M:
      M = l[i]
    else:
      pass
print(M-m)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())
a = list(map(int, input().split()))
max = 0
for i in range(len(a)):
    for j in range(i+1, len(a)):
        print(i,j)
        if abs(a[i] - a[j]) > max:
            max = abs(a[i] - a[j])
print(max)

N = int(input())
a = list(map(int, input().split()))
max = 0
for i in range(len(a)):
    for j in range(i+1, len(a)):
        if abs(a[i] - a[j]) > max:
            max = abs(a[i] - a[j])
print(max)

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n=int(input())

a = [map(int, input().split())]

amin= min(a)
amax= max(a)

res= amax-amin
print(res)


n=int(input())
 
a = list(map(int, input().split()))
amin= min(a)
amax= max(a)
 
res= amax-amin
print(res)

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n = int(input())
a = list(map(int, input().split()))
print(max(a)-min)

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

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n = list(map(int,input().split()))
maxi = max(n)
mini = min(n)
print(maxi - mini)

n = int(input())
l= list(map(int,input().split()))
maxi = max(l)
mini = min(l)
print(maxi - mini)

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n = int(input())
min_A = 10**9+7
max_A = -1
for i in range(n):
  tmp = int(input())
  max_A = max(tmp,max_A)
  min_A = min(min_A,tmp)
  
print(abs(max_A-min_A))


n = int(input())
min_A = 10**9+7
max_A = -1
for i in input().split():
  tmp = int(i)
  max_A = max(tmp,max_A)
  min_A = min(min_A,tmp)
  
print(abs(max_A-min_A))


Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())
A = sorted([int(input()) for _ in range(N)])

print(A[N-1] - A[0])

N = int(input())
A = sorted(map(int, input().split()))

print(A[N-1] - A[0])

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N=int(input())
A=list(map(int,input().split()))
max=0

for i in range(1,N-1):
  for j in range(i+1,N):
    if abs(A[i]-A[j])>=max:
      max=abs(A[i]-A[j])
print(max)

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

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

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n = int(input())
a = list(map(int, input()))
print(max(a) - min(a))

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


Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n = int(input().strip())
arry = list(map(int,input().strip().split()))

min = arry[1]
max = arry[1]

print  (len(arry))

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

print (max-min)


n = int(input().strip())
arry = list(map(int,input().strip().split()))

min = arry[1]
max = arry[1]


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

print (max-min)


Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())

A = [i for i in input().split()]

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

N = int(input())

A = [int(i) for i in input().split()]

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



Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())
list=list(max(int, input().split()))
list.sort()
print(list[-1]-list[0])

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

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
# -*- coding:utf-8 -*-

def solve():
    N = input()
    A = list(map(int, input().split()))
    min_a = 0
    max_a = float("inf")
    for a in A:
        min_a = min(min_a, a)
        max_a = max(max_a, a)
    print(max_a - min_a)

if __name__ == "__main__":
    solve()


# -*- coding:utf-8 -*-

def solve():
    N = input()
    A = list(map(int, input().split()))
    min_a = float("inf")
    max_a = 0
    for a in A:
        min_a = min(min_a, a)
        max_a = max(max_a, a)
    print(max_a - min_a)

if __name__ == "__main__":
    solve()


Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())
A = input()
A = A.split()
L = len(A)
B =[]
for i in range(L):
    B.append(int(a[i]))
B.sort(reverse=True)
ans = B[0] - B[L-1]

print(ans)


N = int(input())
A = input()
A = A.split()
L = len(A)
B =[]
for i in range(L):
    B.append(int(A[i]))
B.sort(reverse=True)
ans = B[0] - B[L-1]

print(ans)



Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n = int(input())
a = map(int,input().split())

ans = 0
for i in range(n):
    for j in range(i):
       t = abs(a[j]-a[i])
       if ans < t:
           ans = t

print(ans)

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

a.sort()

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

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())

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

N = int(input())

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


Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n = input()
A = list(map(int, input().split())
print(int(max(A))-int(min(A)))

N = input()
A = [int(i) for input().split()]
int(max) = 0
int(min) = 0
for i in N:
  if int(max) < A[i]:
    max = A[i]
for i in N:
  if int(min) > A[i]:
    min = A[i]

abs = max - min
print(int(abs))

n = input()
A = list(map(int, input().split()))
print(int(max(A))-int(min(A)))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
def actual(N, a_list):
    num_min = 1
    num_max = 1

    for i in a_list:
        if i < num_min:
            num_min = i
        else:
            num_max = i

    return num_max - num_min

N = int(input())
a_list = map(int, input().split())

print(actual(N, a_list))

def actual(N, a_list):
    s = set(a_list)
    
    return max(s) - min(s)


N = int(input())
a_list = map(int, input().split())

print(actual(N, a_list))

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n = int(input())
nums = [int(num) for num in input().split()]

num_min = nums[0]
num_max = nums[0]
for item in nums:
  if item < num_min:
    num_min = item
  elif item > num_max:
    num_max = item
  else:

print(num_max - num_min)

n = int(input())
nums = [int(num) for num in input().split()]

num_min = nums[0]
num_max = nums[0]
for item in nums:
  if item < num_min:
    num_min = item
  elif item > num_max:
    num_max = item
  else:
    
print(num_max - num_min)

n = int(input())
nums = [int(num) for num in input().split()]

num_min = nums[0]
num_max = nums[0]
for item in nums:
  if item < num_min:
    num_min = item
  else item > num_max:
    num_max = item

print(num_max - num_min)

n = int(input())
nums = [int(num) for num in input().split()]

num_min = nums[0]
num_max = nums[0]
for item in nums:
  if item < num_min:
    num_min = item
  if item > num_max:
    num_max = item

print(num_max - num_min)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
input();a=map(int,input().split());print(max(a)-min(a))

_,a=open(0);*a,=map(int,a.split());print(max(a)-min(a))

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())
A = list(map(int,input().split()))

maxi = A[0]
mini = A[0]
for i in range(N-1):
    if A[i] < A[i+1]:
        maxi = A[i+1]
    if A[i] > A[i+1]:
        mini = A[i+1]
print(maxi-mini)

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

maxi = A[0]
mini = A[0]
for i in range(N):
    if maxi < A[i]:
        maxi = A[i]
    if mini > A[i]:
        mini = A[i]
print(maxi-mini)

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
N = int(input())
a = np.array(list(map(int, input().split())))
print(max(a) - min(a))

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

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
 =int(input())
l =list(map(int,input().split()))
s =(sorted(l))
print(s[-1]-s[0])

A =int(input())
l =list(map(int,input().split()))
s =(sorted(l))
print(s[-1]-s[0])

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n = int(input())
A = list(map(int, input().split()))
ans = 0
for i, a in enumerate(A, 1):
    if i == len(A):
        break
    if ans < abs(a-A[i]):
        ans = abs(a-A[i])
print(ans)


n = int(input())
A = list(map(int, input().split()))
ans = abs(max(A)-min(A))
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n = int(input())
li = list(input())
print(max(li)-min(li))

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

Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
n = int(input())
h = list(map(int,input().split()))
a = int(input())
def getNearestValue(h, a):
	idx = np.abs(np.asarray(h) - a).argmin()
	return h[idx]
print(getNearestValue(h, a))


n = int(input())
mylist = list(map(int,input().split()))
mylist = sorted(mylist, key=abs)
x = mylist[0] - mylist[-1]
print(abs(x))


Verdicts: Runtime Error

Accepted
Problem: You are given an integer sequence A of length N. Find the maximum absolute difference of two elements (with different indices) in A.

Submission attempts (in order):
#!/usr/bin/env python
N = int(input())
A = [int(i) for i in range(N)]

max_ = max(A)
min_ = min(A)
print(max_ - min_)

#!/usr/bin/env python
N = int(input())
A = [int(i) for i in input().split()]

max_ = max(A)
min_ = min(A)
print(max_ - min_)

Verdicts: Wrong Answer

Accepted