← Back to List

25177번: 서강의 역사를 찾아서 ↗

Solutions

Python 3
208 B | 208 chars
n, m = map(int, input().split())

crt = [*map(int, input().split())]
past = [*map(int, input().split())]

ans = max(past[i] - crt[i] for i in range(min(n, m)))
ans = max(ans, max(past[n:] + [0]))

print(ans)