Buggy python submission (verdict: Runtime Error):
#
# P.48 O(n^2)となる単純な回答（比較用）
#
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_D
#
import sys

values = [int(input()) for i in range(input())]

maxv = - sys.maxsize - 1

for i in values:
    for j in values:
        val = i - j
        if maxv < val:
            maxv = val

print(maxv)



Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)

Buggy python submission (verdict: Time Limit Exceeded):
import sys

values = [int(input()) for i in range(int(input()))]

maxv = - sys.maxsize - 1

for c, i in enumerate(values):
    for j in values[c + 1:]:
        val = j - i
        if maxv < val:
            maxv = val

print(maxv)


Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)

Buggy python submission (verdict: Time Limit Exceeded):
#
# P.48 O(n^2)となる単純な回答（比較用）
#
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_D
#
import sys

values = [int(input()) for i in range(int(input()))]

maxv = - sys.maxsize - 1

for c, i in enumerate(values):
    for j in values[c + 1:]:
        maxv = max(maxv, j - i)

print(maxv)



Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)

Buggy python submission (verdict: Runtime Error):
import sys

values = [int(input()) for i in range(int(input()))]

maxv = - sys.maxsize - 1
minv = values[0]

for value in enumerate(values):
    maxv = max(maxv, value - minv)
    minv = min(minv, value)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)

print(maxv)


Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)

Buggy python submission (verdict: Runtime Error):
import sys

values = [int(input()) for i in range(int(input()))]

maxv = - sys.maxsize - 1
minv = values[0]

for value in enumerate(values):
    maxv = max(maxv, value - minv)
    minv = min(minv, value) 

print(maxv)



Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)

Buggy python submission (verdict: Runtime Error):
import sys

input_amount = int(input())
values = [int(input()) for i in range(input_amount)]

maxv = - sys.maxsize - 1
minv = values[0]

for value in enumerate(values):
    maxv = max(maxv, value - minv)
    minv = min(minv, value) 

print(maxv)



Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)

Buggy python submission (verdict: Time Limit Exceeded):
import sys

values = [int(input()) for i in range(int(input()))]

maxv = - sys.maxsize - 1

for c, i in enumerate(values):
    for j in values[c + 1:]:
        maxv = max(maxv, j - i)

print(maxv)



Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)

Buggy python submission (verdict: Runtime Error):
import sys

values = [int(input()) for i in range(int(input()))]
maxv = - sys.maxsize - 1
minv = values[0]

for value in enumerate(values):
    maxv = max(maxv, value - minv)
    minv = min(minv, value) 
print(maxv)



Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)

Buggy python submission (verdict: Runtime Error):
import sys

values = [int(input()) for i in range(int(input()))]
maxv = - 1000000
minv = values[0]

for value in enumerate(values):
    maxv = max(maxv, value - minv)
    minv = min(minv, value)
print(maxv)


Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)

Buggy python submission (verdict: Runtime Error):
values = [int(input()) for i in range(int(input()))]
maxv = - 1000000
minv = values[0]

for value in enumerate(values):
    maxv = max(maxv, value - minv)
    minv = min(minv, value)
print(maxv)


Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)

Buggy python submission (verdict: Runtime Error):
values = [int(input()) for i in range(int(input()))]
maxv = - 1000000
minv = values[0]

for value in enumerate(values):
    maxv = max(maxv, value - minv)
    # minv = min(minv, value)
print(maxv)


Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)

Buggy python submission (verdict: Runtime Error):
values = [int(input()) for i in range(int(input()))]
maxv = - 1000000
minv = values[0]

for value in enumerate(values):
    # maxv = max(maxv, value - minv)
    # minv = min(minv, value)
print(maxv)


Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)

Buggy python submission (verdict: Runtime Error):
values = [int(input()) for i in range(int(input()))]
maxv = - 1000000
minv = values[0]

for val in enumerate(values):
    # maxv = max(maxv, val - minv)
    # minv = min(minv, val)
print(maxv)


Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)

Buggy python submission (verdict: Runtime Error):
values = [int(input()) for i in range(int(input()))]
maxv = - 1000000
minv = values[0]

for val in enumerate(values):
    maxv = max(maxv, val - minv)
print(maxv)


Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)

Buggy python submission (verdict: Runtime Error):
values = [int(input()) for i in range(int(input()))]
maxv = - 1000000
minv = values[0]

for val in enumerate(values):
    maxv = max(maxv, (val - minv))
print(maxv)


Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)

Buggy python submission (verdict: Runtime Error):
values = [int(input()) for i in range(int(input()))]
maxv = -1000000
minv = values[0]

for val in enumerate(values):
    maxv = max(maxv, (val - minv))
print(maxv)


Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)

Buggy python submission (verdict: Runtime Error):
values = [int(input()) for i in range(int(input()))]
maxv = -1000000
minv = values[0]

for val in enumerate(values):
    if (val - minv) > maxv:
        maxv = val - minv
print(maxv)


Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)

Buggy python submission (verdict: Runtime Error):
import sys

values = [int(input()) for i in range(int(input()))]
maxv = - sys.maxsize - 1
minv = values[0]

for val in enumerate(values):
    maxv = max(maxv, (val - minv))
    minv = min(minv, val)
print(maxv)



Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)

Buggy python submission (verdict: Runtime Error):
import sys

values = [int(input()) for i in range(int(input()))]
maxv = - sys.maxsize - 1
minv = values[0]

for val in enumerate(values):
    maxv = max(maxv, (val - minv))
print(maxv)



Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)

Buggy python submission (verdict: Runtime Error):
import sys

values = [int(input()) for i in range(int(input()))]
maxv = - sys.maxsize - 1
minv = values[0]

for val in enumerate(values):
    minv = min(minv, val)
print(maxv)



Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)

Buggy python submission (verdict: Runtime Error):
import sys

values = [int(input()) for i in range(int(input()))]
maxv = - sys.maxsize - 1
minv = values[0]

for val in enumerate(values):
    maxv = max(maxv, (val - minv))
print(maxv)



Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)

Buggy python submission (verdict: Time Limit Exceeded):
import sys

values = [int(input()) for i in range(int(input()))]

maxv = - sys.maxsize - 1

for c, i in enumerate(values):
    for j in values[c + 1:]:
        maxv = max(maxv, j - i)

print(maxv)


Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)

Buggy python submission (verdict: Runtime Error):
import sys

values = [int(input()) for i in range(int(input()))]
maxv = - sys.maxsize - 1
minv = values[0]

for val in enumerate(values):
    if maxv < (val - minv):
        maxv = val - minv
    if minv > val:
        minv = val
print(maxv)


Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)

Buggy python submission (verdict: Time Limit Exceeded):
values = [int(input()) for i in range(int(input()))]

maxv = values[1] - values[0]

for c, i in enumerate(values):
    for j in values[c + 1:]:
        maxv = max(maxv, j - i)

print(maxv)


Fixed submission:
values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)