Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]

ans = 0
for i in range(n-1):
  if a[i] > i[i+1]:
    x += (a[i] - a[i+1])
    a[i+1] = a[i]

print(ans)

Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]
ans = 0
for i in range(N-1):
    if A[i]>A[i+1]:
        ans += A[i]-A[i+1]
        A[i+1] = A[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]

ans = 0
for i in range(n-1):
    if a[i] > i[i+1]:
        x += a[i] - a[i+1]
        a[i+1] = a[i]

print(ans)

Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]
ans = 0
for i in range(N-1):
    if A[i]>A[i+1]:
        ans += A[i]-A[i+1]
        A[i+1] = A[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]

ans = 0
for i in range(n-1):
  if a[i] > i[i+1]:
    x += a[i] - a[i+1]
    a[i+1] = a[i]

print(x)


Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]
ans = 0
for i in range(N-1):
    if A[i]>A[i+1]:
        ans += A[i]-A[i+1]
        A[i+1] = A[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]

x = 0
for i in range(n-1):
  if a[i] > i[i+1]:
    x += a[i] - a[i+1]
    a[i+1] = a[i]

print(x)

Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]
ans = 0
for i in range(N-1):
    if A[i]>A[i+1]:
        ans += A[i]-A[i+1]
        A[i+1] = A[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

x = 0
for i in range(n-1):
  if a[i] > i[i+1]:
    x += a[i] - a[i+1]
    a[i+1] = a[i]

print(x)

Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]
ans = 0
for i in range(N-1):
    if A[i]>A[i+1]:
        ans += A[i]-A[i+1]
        A[i+1] = A[i]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
 
x = 0
for i in range(n-1):
  while True:
    if a[i] > a[i + 1]:
      a[i + 1] += 1
      x += 1
    if a[i] <= a[i + 1]:
      break
 
print(x)

Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]
ans = 0
for i in range(N-1):
    if A[i]>A[i+1]:
        ans += A[i]-A[i+1]
        A[i+1] = A[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

x = 0
for i in range(n):
  while True:
    if a[i] > a[i + 1]:
      a[i + 1] += 1
      x += 1
    if a[i] <= a[i + 1]:
      break

print(x)

Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]
ans = 0
for i in range(N-1):
    if A[i]>A[i+1]:
        ans += A[i]-A[i+1]
        A[i+1] = A[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

x = 0
for i in range(n):
  while True:
    if a[i] > a[i + 1]:
      a[i + 1] += 1
      x += 1
    if a[i] <= a[i + 1]:
      break

print(x)

Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]
ans = 0
for i in range(N-1):
    if A[i]>A[i+1]:
        ans += A[i]-A[i+1]
        A[i+1] = A[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

x = 0
for i in range(n):
  while Ture:
    if a[i] > a[i + 1]:
      a[i + 1] += 1
      x += 1
    if a[i] <= a[i + 1]:
      break

print(x)

Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]
ans = 0
for i in range(N-1):
    if A[i]>A[i+1]:
        ans += A[i]-A[i+1]
        A[i+1] = A[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = map(int, [input() for i in range(n)])

x = 0
while True:
  data = map(lambda a: a + x, a)
  data1 = data.sort()
  if len(data1) == len(set(data1)):
    break:
  else:
    x += 1

print(x * n)

Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]
ans = 0
for i in range(N-1):
    if A[i]>A[i+1]:
        ans += A[i]-A[i+1]
        A[i+1] = A[i]
print(ans)