Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import bisect
input = sys.stdin.readline

N = int(input())
L = sorted(list(map(int, input().split())))
ans = 0
for i in range(N - 2):
    for j in range(i + 1, N - 1):
        l = L[j + 1:]
        index = bisect.bisect_left(l, L[i] + L[j])
        ans += index

print(ans)


Fixed submission:
import sys
import bisect
input = sys.stdin.readline

N = int(input())
L = sorted(list(map(int, input().split())))
ans = 0
for i in range(N - 2):
    for j in range(i + 1, N - 1):
        index = bisect.bisect_left(L, L[i] + L[j])
        n = index - j - 1
        ans += n

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

N = int(input())
L = sorted(list(map(int, input().split())))

ans = 0
for i in range(N - 2):
    for j in range(i + 1, N - 1):
        ans += sum(L[i] + L[j] > l for l in L[j+1:])

print(ans)


Fixed submission:
import sys
import bisect
input = sys.stdin.readline

N = int(input())
L = sorted(list(map(int, input().split())))
ans = 0
for i in range(N - 2):
    for j in range(i + 1, N - 1):
        index = bisect.bisect_left(L, L[i] + L[j])
        n = index - j - 1
        ans += n

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import numpy as np
input = sys.stdin.readline

N = int(input())
L = np.sort(np.array(list(map(int, input().split()))))

ans = 0
for i in range(N - 2):
    for j in range(i + 1, N - 1):
        t = np.count_nonzero(L[j + 1:] < L[i] + L[j])
        ans += t

print(ans)


Fixed submission:
import sys
import bisect
input = sys.stdin.readline

N = int(input())
L = sorted(list(map(int, input().split())))
ans = 0
for i in range(N - 2):
    for j in range(i + 1, N - 1):
        index = bisect.bisect_left(L, L[i] + L[j])
        n = index - j - 1
        ans += n

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import numpy as np
input = sys.stdin.readline

N = int(input())
L = np.sort(np.array(list(map(int, input().split()))))

ans = 0
for i in range(N):
    for j in range(i + 1, N - 1):
        t = np.count_nonzero(L[j + 1:] < L[i] + L[j])
        if not t:
            continue
        else:
            ans += t

print(ans)


Fixed submission:
import sys
import bisect
input = sys.stdin.readline

N = int(input())
L = sorted(list(map(int, input().split())))
ans = 0
for i in range(N - 2):
    for j in range(i + 1, N - 1):
        index = bisect.bisect_left(L, L[i] + L[j])
        n = index - j - 1
        ans += n

print(ans)
Buggy python submission (verdict: Runtime Error):
import math

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

N = int(input())
a = [input() for _ in range(N)]

d = dict()
for x in a:
  s = ''.join(sorted(x))
  if s not in d.keys():
    d[s] = 1
  else:
    d[s] += 1

print(sum([comb(i, 2) for i in d.values()]))

Fixed submission:
from scipy.special import comb
N = int(input())
a = [input() for _ in range(N)]

d = dict()
for x in a:
  s = ''.join(sorted(x))
  if s not in d.keys():
    d[s] = 1
  else:
    d[s] += 1

print(sum([comb(i, 2, exact=True) for i in d.values()]))

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N = int(input())
a = [input() for _ in range(N)]

cc = [sorted(Counter(x).most_common()) for x in a]
ans = 0
for i in range(N):
  for j in range(i + 1, N):
    if cc[i] == cc[j]:
      ans += 1
      
print(ans)

Fixed submission:
from scipy.special import comb
N = int(input())
a = [input() for _ in range(N)]

d = dict()
for x in a:
  s = ''.join(sorted(x))
  if s not in d.keys():
    d[s] = 1
  else:
    d[s] += 1

print(sum([comb(i, 2, exact=True) for i in d.values()]))
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
LR = [list(map(int, input().split())) for _ in range(M)]
ans = set(range(1, N + 1))
for lr in LR:
  ans = ans & set(range(lr[0], lr[1] + 1))
  
print(len(ans))

Fixed submission:
N, M = map(int, input().split())
LR = [list(map(int, input().split())) for _ in range(M)]
l = 0
r = 100001
for lr in LR:
  l = max(lr[0], l)
  r = min(r, lr[1])
  
print(r - l + 1 if r - l >= 0 else 0)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys,sydin.readline

S = input().strip()
a = ['A', 'T', 'G', 'C']

ans = 0
j = []
for i in range(len(S)):
  j = i
  count = 0
  while True:
    if j >= len(S):
      break
    if S[j] in a:
      count += 1
      j += 1
    else:
      ans = max(ans, count)
      break
  
print(ans)

Fixed submission:
import sys
input = sys.stdin.readline

S = input().strip()
a = ['A', 'T', 'G', 'C']

ans = 0
j = []
for i in range(len(S)):
  j = i
  count = 0
  while True:
    ans = max(ans, count)
    if j >= len(S):
      break
    if S[j] in a:
      count += 1
      j += 1
    else:
      break
  
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
if not len(S):
  print(0)
else:
  N = len(S)
  ans = 0
  while 1:
    S = S.replace('10', '')
    tmp1 = N - len(S)
    N = len(S)
    S = S.replace('01', '')
    tmp2 = N - len(S)
    N = len(S)
    if not tmp1 + tmp2:
      break
    else:
      ans += tmp1 + tmp2
  print(ans)

Fixed submission:
S = input()
print(min(S.count('0'), S.count('1')) * 2)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
if not len(S):
  print(0)
else:
  N = len(S)
  ans = 0
  while '10' in S or '01' in S:
    S = S.replace('10', '')
    ans += N - len(S)
    N = len(S)
    S = S.replace('01', '')
    ans += N - len(S)
    N = len(S)
  print(ans)

Fixed submission:
S = input()
print(min(S.count('0'), S.count('1')) * 2)
Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    N, K = readnums()
    h = np.sort(np.array([readint() for _ in range(N)]))
    ans = 0
    for i in range(N - K + 1):
        if not i:
            ans = h[i + 2] - h[i]
        else:
            ans = min(ans, h[i + 2] - h[i])

    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
import sys
import numpy as np
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    N, K = readnums()
    h = np.sort(np.array([readint() for _ in range(N)]))
    ans = 0
    for i in range(N - K + 1):
        if not i:
            ans = h[i + K - 1] - h[i]
        else:
            ans = min(ans, h[i + K - 1] - h[i])

    print(ans)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
import sys
from collections import Counter
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    n = readint()
    v = list(readnums())
    ve = [x for i, x in enumerate(v) if not i % 2]
    vo = [x for i, x in enumerate(v) if i % 2]
    cve = Counter(ve)
    cvo = Counter(vo)
    if cve.most_common()[0][0] == cvo.most_common()[0][0]:
        print(min(len(ve) - cve.most_common()[1][1] + len(vo) - cvo.most_common()[0][1], len(ve) - cve.most_common()[0][1] + len(vo) - cvo.most_common()[1][1]))
    else:
        print(len(ve) - cve.most_common()[0][1] + len(vo) - cvo.most_common()[0][1])


if __name__ == "__main__":
    main()


Fixed submission:
import sys
from collections import Counter
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    n = readint()
    v = list(readnums())
    ve = [x for i, x in enumerate(v) if not i % 2]
    vo = [x for i, x in enumerate(v) if i % 2]
    cve = Counter(ve)
    cvo = Counter(vo)
    if cve.most_common()[0][0] == cvo.most_common()[0][0]:
        if len(cve) == 1:
            print(n // 2)
        else:
            print(min(len(ve) - cve.most_common()[1][1] + len(vo) - cvo.most_common()[0][1], len(ve) - cve.most_common()[0][1] + len(vo) - cvo.most_common()[1][1]))
    else:
        print(len(ve) - cve.most_common()[0][1] + len(vo) - cvo.most_common()[0][1])


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
 
 
def readstr():
    return input().strip()
 
 
def readint():
    return int(input())
 
 
def readnums():
    return map(int, input().split())
 
 
def readstrs():
    return input().split()
 
 
def main():
    N = readint()
    X = list(readnums())
    xs = sorted(X)
    for i in X:
        d = xs.index(i)
        if d >= N // 2:
            print(xs[N // 2 - 1])
        else:
            print(xs[N // 2])
 
 
if __name__ == "__main__":
    main()

Fixed submission:
import sys
import bisect
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    N = readint()
    X = list(readnums())
    xs = sorted(X)
    for i in X:
        d = bisect.bisect_left(xs, i)
        if d >= N // 2:
            print(xs[N // 2 - 1])
        else:
            print(xs[N // 2])


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    N = readint()
    X = list(readnums())
    xs = sorted(X)
    for i in X:
        d = xs.index(i)
        if d >= N // 2:
            print(xs[N // 2 - 1])
        else:
            print(xs[N // 2])


if __name__ == "__main__":
    main()


Fixed submission:
import sys
import bisect
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    N = readint()
    X = list(readnums())
    xs = sorted(X)
    for i in X:
        d = bisect.bisect_left(xs, i)
        if d >= N // 2:
            print(xs[N // 2 - 1])
        else:
            print(xs[N // 2])


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
if sum(A, B, C) % 2 == max(A, B, C) * 3:
  print((max(A, B, C) * 3 - sum(A, B, C)) // 2)
else:
  print(((max(A, B, C) + 1) * 3 - sum(A, B, C)) // 2)

Fixed submission:
A, B, C = map(int, input().split())
if sum((A, B, C)) % 2 == max(A, B, C) % 2:
  print((max(A, B, C) * 3 - sum((A, B, C))) // 2)
else:
  print(((max(A, B, C) + 1) * 3 - sum((A, B, C))) // 2)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    abcd = list(map(int, list(readstr())))
    l = [['+', '+', '+'], ['+', '+', '-'], ['+', '-', '+'], ['+', '-', '-'], ['-', '+', '+'], ['-', '+', '-'], ['-', '-', '+'], ['-', '-', '-']]
    for ll in l:
        ans = abcd[0]
        for i, x in enumerate(ll):
            if x == '+':
                ans += abcd[i + 1]
            else:
                ans -= abcd[i + 1]
        if ans == 7:
            print(f'{abcd[0]}{ll[0]}{abcd[1]}{ll[1]}{abcd[2]}{ll[2]}{abcd[3]}=7')
            break


if __name__ == "__main__":
    main()


Fixed submission:
import sys
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    abcd = list(map(int, list(readstr())))
    l = [['+', '+', '+'], ['+', '+', '-'], ['+', '-', '+'], ['+', '-', '-'], ['-', '+', '+'], ['-', '+', '-'], ['-', '-', '+'], ['-', '-', '-']]
    for ll in l:
        ans = abcd[0]
        for i, x in enumerate(ll):
            if x == '+':
                ans += abcd[i + 1]
            else:
                ans -= abcd[i + 1]
        if ans == 7:
            s = ''
            for i in range(3):
                s += str(abcd[i]) + ll[i]
            s += str(abcd[3])
            print(s + '=7')
            break


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):

  
  import sys
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


N, P = readnums()
A = map(lambda x: x % 2, readnums())

if not sum(A):
    print(0)
else:
    print(2 ** N // 2)


Fixed submission:
import sys
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


N, P = readnums()
A = map(lambda x: x % 2, readnums())

if P:
    if not sum(A):
        print(0)
    else:
        print(2 ** N // 2)
else:
    if not sum(A):
        print(2 ** N)
    else:
        print(2 ** N // 2)
Buggy python submission (verdict: Runtime Error):
import sys
import math
input = sys.stdin.readline

N = int(input())
a = int(math.sqrt(N))

A = 0
B = 0
for i in reversed(range(1, a + 1)):
  if not N % i:
    A = i
    B = N // A
    break

print(max(len(str(A)), len(str(B)))

Fixed submission:
import sys
import math
input = sys.stdin.readline
 
N = int(input())
a = int(math.sqrt(N))
 
A = 0
B = 0
for i in reversed(range(1, a + 1)):
  if not N % i:
    A = i
    B = N // A
    break
 
print(max(len(str(A)), len(str(B))))
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
timeline = []
for i in range(M):
    P, Y = map(int, input().split())
    timeline.append((Y, P, i))
timeline.sort()
count = [0] * (N + 1)
number = [(0, 0)] * M
for y, p, i in timeline:
    count[p] += 1
    number[i] = (p, count[p])
for i in range(M):
    print(f'{number[i][0]:06}{number[i][1]:06}')


Fixed submission:
N, M = map(int, input().split())
timeline = []
for i in range(M):
    P, Y = map(int, input().split())
    timeline.append((Y, P, i))
timeline.sort()
count = [0] * (N + 1)
number = [(0, 0)] * M
for y, p, i in timeline:
    count[p] += 1
    number[i] = (p, count[p])
for i in range(M):
    print('{:06}{:06}'.format(number[i][0], number[i][1]))
Buggy python submission (verdict: Runtime Error):
S=input()+'2'
prev=S[0]
cnt=1
li=[]
for i in range(1,len(S)):
    if S[i]!=prev:
        li.append(cnt)
        prev=S[i]
        cnt=1
    else:
        cnt+=1
if len(li)==1:
    print(li[0])
elif len(li)==2:
    print(max(li))
elif len(li)%2==1:
    ans=li[0]+li[1]
    for i in range(len(li)-1):
        ans=min(ans,li[i]+li[i+1])
    print(ans)
else:
    ans1=li[0]+li[1]
    ans2=li[1]+li[2]
    for i in range(len(li)-2):
        ans1=min(ans1,li[i]+li[i+1])
    for i in range(1,len(li)-1):
        ans2=min(ans2,li[i]+li[i+1])
    print(max(a1,a2))

Fixed submission:
S=input()
prev=S[0]
T=len(S)
for i in range(1, len(S)):
    if S[i]!=prev:
        T=min(T,max(i,len(S)-i))
        prev=S[i]
print(T)
Buggy python submission (verdict: Runtime Error):
N=int(input())
num={}
for a in input().split():
  num[a]+=1
ans=0
for k,v in num:
  if k>v:
    ans+=v
  else:
    ans+=v-k
print(ans)

Fixed submission:
import collections
N=int(input())
A=[int(a) for a in input().split()]
c=collections.Counter(A)
ans=0
for k,v in c.items():
  if k>v:
    ans+=v
  else:
    ans+=v-k
print(ans)
Buggy python submission (verdict: Runtime Error):
n,z,w=map(int,input().split())
A=[int(x) for x in input().split()]
print(max(abs(A[n-2]-A[n-1]),abs(A[n-1],w))) if n!=1 else print(abs(a[0]-w))

Fixed submission:
n,z,w=map(int,input().split())
A=[int(x) for x in input().split()]
print(max(abs(A[n-2]-A[n-1]),abs(A[n-1]-w))) if n!=1 else print(abs(A[0]-w))
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

N = len(T)
count = 0
count_list = []

index_list = []

if len(S)-len(T) != 0:
    for i in range(len(S)-N+1):
        index_list.append(S[0+i:N+i])

    for i in range(len(index_list)):
        count = 0
        for j in range(N):
            if index_list[i][j] == T[j]:
                count +=1
                count_list.append(count)
                
    print(N - max(count_list))
else:
    for i in range(N):
        if S[i] == T[i]:
            count += 1
    print(N - count)

Fixed submission:
S = input()
T = input()

N = len(T)
count = 0
count_list = []
index_list = []

if len(S)-len(T) != 0:
    for i in range(len(S)-N+1):
        index_list.append(S[0+i:N+i])

    for i in range(len(index_list)):
        count = 0
        for j in range(N):
            if index_list[i][j] == T[j]:
                count +=1
        count_list.append(count)
                
    print(N - max(count_list))
else:
    for i in range(N):
        if S[i] == T[i]:
            count += 1
    print(N - count)

Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

N = len(T)
count = 0
count_list = []

index_list = []

if len(S)-len(T) != 0:
    for i in range(len(S)-N):
        index_list.append(S[0+i:N+i])

    for i in range(len(index_list)):
        count = 0
        for j in range(N):
            if index_list[i][j] == T[j]:
                count +=1
                count_list.append(count)
                
    print(N - max(count_list))
else:
    for i in range(N):
        if S[i] == T[i]:
            count += 1
    print(N - count)

Fixed submission:
S = input()
T = input()

N = len(T)
count = 0
count_list = []
index_list = []

if len(S)-len(T) != 0:
    for i in range(len(S)-N+1):
        index_list.append(S[0+i:N+i])

    for i in range(len(index_list)):
        count = 0
        for j in range(N):
            if index_list[i][j] == T[j]:
                count +=1
        count_list.append(count)
                
    print(N - max(count_list))
else:
    for i in range(N):
        if S[i] == T[i]:
            count += 1
    print(N - count)
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
s1 = list(S)
t1 = list(T)
a = len(s1); b = len(t1)
z = []
for i in range(a-b):
    x = []
    y = 0
    for j in range(b):
        x.append(s1[i+j])
    for k in range(b):
        if t1[k]==x[k]:
            y += 1
    z.append(y)
print(b-max(z))

Fixed submission:
S = input()
T = input()
s1 = list(S)
t1 = list(T)
a = len(s1); b = len(t1)
z = []
for i in range(a-b+1):
    x = []
    y = 0
    for j in range(b):
        x.append(s1[i+j])
    for k in range(b):
        if t1[k]==x[k]:
            y += 1
    z.append(y)
print(b-max(z))
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split()))
t = [];s = 0
for i in range(N):
    for j in range(N):
        if i != j:
            if a[i]*a[j]<10**9+7:
                t.append(a[i]*a[j])
            else:
                t.append(a[i]%7*a%[j]%7)
for i in t:
    s += i
s = s//2
print(s%10**9+7)

Fixed submission:
import itertools
N = int(input())
a = list(map(int,input().split()))
a2 = itertools.accumulate(a)
b = [0]
b += list(a2)
s = 0
for i in range(N):
    s += (a[i] * (b[-1] - b[i+1]))
print(s % (10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(map(int,input().split()))
t = [];s = 0
for i in range(N):
    for j in range(N):
        if i != j:
            t.append(a[i]*a[j])
for i in t:
    s += i
s = s//2
print(s%(10**9+7))

Fixed submission:
import itertools
N = int(input())
a = list(map(int,input().split()))
a2 = itertools.accumulate(a)
b = [0]
b += list(a2)
s = 0
for i in range(N):
    s += (a[i] * (b[-1] - b[i+1]))
print(s % (10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
a = list(map(int,input().split()))
t = []; u = 1
for i in range(K):
    u *= a[K-i-1]
t.append(u)
for i in range(1,N-K+1):
    u = u / a[i-1]
    u = u * a[K+i-1]
    t.append(u)
    if t[i-1]<t[i]:
        print("Yes")
    else:
        print("No")

Fixed submission:
N,K = map(int,input().split())
a = list(map(int,input().split()))
for i in range(1,N-K+1):
    if a[K+i-1]>a[i-1]:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
a = list(map(int,input().split()))
t = []
for i in range(N-K+1):
    s = 1
    for j in range(0,K):
        s = s * a[K+i-j-1]
    t.append(s)
    if i != 0:
        if t[i-1]<t[i]:
            print("Yes")
        else:
            print("No")

Fixed submission:
N,K = map(int,input().split())
a = list(map(int,input().split()))
for i in range(1,N-K+1):
    if a[K+i-1]>a[i-1]:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
a = input()
print(a[3]+a[4]+a[5])

Fixed submission:
a = input()
print(a[0]+a[1]+a[2])
Buggy python submission (verdict: Runtime Error):
import math
A,B,H,M = map(float,input().split())
vec = 0
c = abs((30.0*H + M*0.5) - (M*6.0))
if c <= 180.0:
    vec = c
else:
    vec = 360.0 - c
ans = math.sqrt(A**2 + B**2 - 2.0*A*B*math.cos(vec))
print(ans)

Fixed submission:
N = int(input())
if N%10==2 or N%10==4 or N%10==5 or N%10==7 or N%10==9:
    print("hon")
elif N%10==0 or N%10==1 or N%10==6 or N%10==8:
    print("pon")
elif N%10==3:
    print("bon")
Buggy python submission (verdict: Runtime Error):
N = int(input())
list_a = list(map(int,input().split()))
list_a.sort(reverse=True)
alice = 0; bob = 0
for i in range(0,100):
    if i % 2 == 0:
        alice += list_a[i]
    else:
        bob += list_a[i]
print(alice-bob)
    


Fixed submission:
N = int(input())
list_a = list(map(int,input().split()))
list_a.sort(reverse=True)
alice = 0; bob = 0
for i in range(len(list_a)):
    if i % 2 == 0:
        alice += list_a[i]
    else:
        bob += list_a[i]
print(alice-bob)

Buggy python submission (verdict: Runtime Error):
N = int(input())
list_a = list(map(int,input().split()))
list_b = list_a.sort()
alice = 0; bob = 0
for i in range(100):
    if i % 2 == 0:
        alice += list_b[i]
    else:
        bob += list_b[i]
print(alice-bob)
    

Fixed submission:
N = int(input())
list_a = list(map(int,input().split()))
list_a.sort(reverse=True)
alice = 0; bob = 0
for i in range(len(list_a)):
    if i % 2 == 0:
        alice += list_a[i]
    else:
        bob += list_a[i]
print(alice-bob)
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = [list(map(int,input().split())) for i in range(2)]
s = 0; t = 0; u = 0; v = 0
for i in range(0,N):
    for j in range(0,i+1):
        s += a[0][j]
        t += a[1][j]
        u += a[0][N-j-1]
        v += a[1][N-j-1]
	if s>=t and v>=u:
        print(s+v)

Fixed submission:
N = int(input())
a = [list(map(int,input().split())) for i in range(2)]
b = []
for i in range(0,N):
    s = 0
    v = 0
    for j in range(0,i+1):
        s += a[0][j]
    for j in range(i,N):
        v += a[1][j]
    b.append(s+v)
print(max(b))
Buggy python submission (verdict: Runtime Error):
N = int(input())
list_a = [int(input()) for i in range(N)]
s = []
for i in list_a:
    if s.count(i) == 0
        s.append(i)
print(len(s))

Fixed submission:
N = int(input())
list_a = [int(input()) for i in range(N)]
s = []
for i in list_a:
    if s.count(i) == 0:
        s.append(i)
print(len(s))