Skip to content

Instantly share code, notes, and snippets.

@AngelOnFira
Created April 6, 2019 15:23
Show Gist options
  • Select an option

  • Save AngelOnFira/69e9b494735ae1c156eb04ad0cdae16b to your computer and use it in GitHub Desktop.

Select an option

Save AngelOnFira/69e9b494735ae1c156eb04ad0cdae16b to your computer and use it in GitHub Desktop.
import sys
from collections import defaultdict
t=sys.stdin.readline()
l=[]
while t:
l.append(int(t.strip()))
t = sys.stdin.readline()
# l = l[1:]
max = 0
for i, first in enumerate(l):
a = l[i + 1:]
for second in a:
if second - first > max:
max = second - first
print(max)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment