Buggy python submission (verdict: Runtime Error):
import sys
 
if __name__ == ‘__main__’:
    args = sys.argv
    prices = map(int, args[1:])
    min = prices[1]

    max_profit = 0
    for price in prices:
        if min > price:
            min = price
        max_profit = price - min

    return max_profit


Fixed submission:
n = input()
prices = list()
for idx in range(int(n)):
    tmp = input()
    prices.append(int(tmp))

minp = prices[0]
maxv = prices[1] - prices[0]

for price in prices[1:]:
    maxv = max(maxv, price - minp)
    minp = min(minp, price)

print(maxv)

Buggy python submission (verdict: Runtime Error):
import sys
 
if __name__ == ‘__main__’:
    args = sys.argv
    prices = map(int, args[1:])
    min = prices[0]

    max_profit = 0
    for price in prices:
        if min > price:
            min = price
        max_profit = price - min

    return max_profit


Fixed submission:
n = input()
prices = list()
for idx in range(int(n)):
    tmp = input()
    prices.append(int(tmp))

minp = prices[0]
maxv = prices[1] - prices[0]

for price in prices[1:]:
    maxv = max(maxv, price - minp)
    minp = min(minp, price)

print(maxv)

Buggy python submission (verdict: Runtime Error):
import sys
 
args = sys.argv
prices = map(int, args[1:])
min = prices[0]

max_profit = 0
for price in prices:
    if min > price:
        min = price
    max_profit = price - min

print(max_profit)


Fixed submission:
n = input()
prices = list()
for idx in range(int(n)):
    tmp = input()
    prices.append(int(tmp))

minp = prices[0]
maxv = prices[1] - prices[0]

for price in prices[1:]:
    maxv = max(maxv, price - minp)
    minp = min(minp, price)

print(maxv)

Buggy python submission (verdict: Runtime Error):
import sys
 
args = sys.argv
prices = map(int, args[2:])
min = prices[0]
max_profit = 0

for price in prices:
    if min > price:
        min = price
    max_profit = price - min

print(max_profit)


Fixed submission:
n = input()
prices = list()
for idx in range(int(n)):
    tmp = input()
    prices.append(int(tmp))

minp = prices[0]
maxv = prices[1] - prices[0]

for price in prices[1:]:
    maxv = max(maxv, price - minp)
    minp = min(minp, price)

print(maxv)

Buggy python submission (verdict: Runtime Error):
import sys
 
args = sys.argv
prices = map(int, args[2:])
min = prices[0]
max_profit = 0

for price in prices:
    if min > price:
        min = price
    max_profit = price - min

print(max_profit)


Fixed submission:
n = input()
prices = list()
for idx in range(int(n)):
    tmp = input()
    prices.append(int(tmp))

minp = prices[0]
maxv = prices[1] - prices[0]

for price in prices[1:]:
    maxv = max(maxv, price - minp)
    minp = min(minp, price)

print(maxv)

Buggy python submission (verdict: Runtime Error):
import sys
 
args = sys.argv
prices = list(map(int, args[2:]))
min = prices[0]
max_profit = 0

for price in prices:
    if min > price:
        min = price
    max_profit = price - min

print(max_profit)


Fixed submission:
n = input()
prices = list()
for idx in range(int(n)):
    tmp = input()
    prices.append(int(tmp))

minp = prices[0]
maxv = prices[1] - prices[0]

for price in prices[1:]:
    maxv = max(maxv, price - minp)
    minp = min(minp, price)

print(maxv)

Buggy python submission (verdict: Runtime Error):
import sys
 
args = sys.argv
prices = list(map(int, args[2:]))
min = prices[0]
max_profit = 0

for price in prices:
    if min > price:
        min = price
    max_profit = price - min

print(max_profit)


Fixed submission:
n = input()
prices = list()
for idx in range(int(n)):
    tmp = input()
    prices.append(int(tmp))

minp = prices[0]
maxv = prices[1] - prices[0]

for price in prices[1:]:
    maxv = max(maxv, price - minp)
    minp = min(minp, price)

print(maxv)

Buggy python submission (verdict: Runtime Error):
import sys
 
args = sys.argv
prices = list(map(int, args[2:]))
min = prices[0]
max_profit = 0

for price in prices:
    if min > price:
        min = price
    max_profit = price - min

print(max_profit)


Fixed submission:
n = input()
prices = list()
for idx in range(int(n)):
    tmp = input()
    prices.append(int(tmp))

minp = prices[0]
maxv = prices[1] - prices[0]

for price in prices[1:]:
    maxv = max(maxv, price - minp)
    minp = min(minp, price)

print(maxv)

Buggy python submission (verdict: Runtime Error):
import sys
 
args = sys.argv
prices = list(map(int, args[2:]))
min = prices[0]
max_profit = 0

for price in prices[1:]:
    max_profit = price - min
    if min > price:
        min = price

print(max_profit)


Fixed submission:
n = input()
prices = list()
for idx in range(int(n)):
    tmp = input()
    prices.append(int(tmp))

minp = prices[0]
maxv = prices[1] - prices[0]

for price in prices[1:]:
    maxv = max(maxv, price - minp)
    minp = min(minp, price)

print(maxv)

Buggy python submission (verdict: Runtime Error):
n = input()
prices = list()
for idx in range(n):
    tmp = index()
    prices.append(tmp)

minp = prices[0]
maxv = prices[1] - prices[0]

for price in prices:
    maxp = max(maxp, price - min)
    minv = min(minv, price)

print(maxp)


Fixed submission:
n = input()
prices = list()
for idx in range(int(n)):
    tmp = input()
    prices.append(int(tmp))

minp = prices[0]
maxv = prices[1] - prices[0]

for price in prices[1:]:
    maxv = max(maxv, price - minp)
    minp = min(minp, price)

print(maxv)