[READ-ONLY] Mirror of https://github.com/shuuji3/competitive-programming. 馃洬 Codes submitted to competitive programming platforms
aizu-online-jadge aoj atcoder hackerrank leetcode
0

Configure Feed

Select the types of activity you want to include in your feed.

1n = int(input()) 2max_diff = -10**10 3 4current_min = int(input()) 5 6for _ in range(n-1): 7 current = int(input()) 8 diff = current - current_min 9 if diff > max_diff: 10 max_diff = diff 11 if current < current_min: 12 current_min = current 13print(max_diff)