私の解答
n = int(input())
a = list(map(int, input().split()))
print(max(a), min(a))
解答例1
N = int(input())
A = [0] * N
values = input().split()
for i in range(N):
A[i] = int(values[i])
sorted_A = sorted(A)
print(sorted_A[N - 1], sorted_A[0])
解答例2
N = int(input())
A = [int(x) for x in input().split()]
print(max(A), min(A))