Buggy python submission (verdict: Runtime Error):
import math
N = int (input ())
L = input ().split ()
l = [int(s) for s in L]
list.sort (l, reverse=True)
a = 0
x = 0
m = math.ceil(N/2)
for i in range (m):
    x += int (l[a])
    a += 2
a = 1
y = 0
for i in range (N-m):
    y += int (l[a])
    b += 2
print (x-y)

Fixed submission:
N = int (input ())
L = input ().split ()
l = [int(s) for s in L]
list.sort (l, reverse=True)
a = 0
x = 0
y = 0
while True:
    x += int (l[a])
    a += 1
    if a == N:
        break
    y += int (l[a])
    a += 1
    if a == N:
        break
print (x-y)

Buggy python submission (verdict: Runtime Error):
import math
N = int (input ())
l = input ().split ()
l = [int(s) for s in l]
list.sort (l, reverse=True)
a = 0
x = 0
m = math.ceil(N/2)
for i in range (m):
    x += int (l[a])
    a += 2
a = 1
y = 0
for i in range (N-m):
    y += int (l[a])
    b += 2
print (x-y)

Fixed submission:
N = int (input ())
L = input ().split ()
l = [int(s) for s in L]
list.sort (l, reverse=True)
a = 0
x = 0
y = 0
while True:
    x += int (l[a])
    a += 1
    if a == N:
        break
    y += int (l[a])
    a += 1
    if a == N:
        break
print (x-y)

Buggy python submission (verdict: Runtime Error):
N = int (input ())
l = input ().split ()
list.sort (l, reverse=True)
a = 0
x = 0
for i in range (round(N/2)):
    x += int (l[a])
    a += 2
b = 1
y = 0
for i in range (N-(round(N/2))):
    y += int (l[b])
    b += 2
print (x-y)

Fixed submission:
N = int (input ())
L = input ().split ()
l = [int(s) for s in L]
list.sort (l, reverse=True)
a = 0
x = 0
y = 0
while True:
    x += int (l[a])
    a += 1
    if a == N:
        break
    y += int (l[a])
    a += 1
    if a == N:
        break
print (x-y)

Buggy python submission (verdict: Runtime Error):
N = int (input ())
l = input ().split ()
list.sort (l, reverse=True)
a = 0
x = 0
for i in range (round(N/2)):
    x += int (l[a])
    a += 2
a = 1
y = 0
for i in range (N-(round(N/2))):
    y += int (l[a])
    a += 2
print (x-y)

Fixed submission:
N = int (input ())
L = input ().split ()
l = [int(s) for s in L]
list.sort (l, reverse=True)
a = 0
x = 0
y = 0
while True:
    x += int (l[a])
    a += 1
    if a == N:
        break
    y += int (l[a])
    a += 1
    if a == N:
        break
print (x-y)

Buggy python submission (verdict: Runtime Error):
N = int (input ())
l = input ().split ()
list.sort (l, reverse=True)
a = 0
x = 0
for i in range (round(N/2)):
    x += int (l[a])
    a += 2
a = 1
y = 0
for i in range (N-(round(N/2))):
    y += int (l[a])
    a += 2
print (x-y)

Fixed submission:
N = int (input ())
L = input ().split ()
l = [int(s) for s in L]
list.sort (l, reverse=True)
a = 0
x = 0
y = 0
while True:
    x += int (l[a])
    a += 1
    if a == N:
        break
    y += int (l[a])
    a += 1
    if a == N:
        break
print (x-y)

Buggy python submission (verdict: Runtime Error):
N = int (input ())
l = input ().split ()
list.sort (l, reverse=True)
a = 0
x = 0
for i in range (round(N/2)):
    x += l[a]
    a += 2
a = 1
y = 0
for i in range (N-(round(N/2))):
    y += l[a]
    a += 2
print (x-y)

Fixed submission:
N = int (input ())
L = input ().split ()
l = [int(s) for s in L]
list.sort (l, reverse=True)
a = 0
x = 0
y = 0
while True:
    x += int (l[a])
    a += 1
    if a == N:
        break
    y += int (l[a])
    a += 1
    if a == N:
        break
print (x-y)

Buggy python submission (verdict: Runtime Error):
N = int (input ())
l = []
for i in range (N):
    a = int (input ())
    l.append (a)
list.sort (l, reverse=True)
a = 0
x = 0
for i in range (round(N/2)):
    x += l[a]
    a += 2
a = 1
y = 0
for i in range (N-(round(N/2))):
    y += l[a]
    a += 2
print (x-y)

Fixed submission:
N = int (input ())
L = input ().split ()
l = [int(s) for s in L]
list.sort (l, reverse=True)
a = 0
x = 0
y = 0
while True:
    x += int (l[a])
    a += 1
    if a == N:
        break
    y += int (l[a])
    a += 1
    if a == N:
        break
print (x-y)