Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

a,b,c,d=map(int,input().split())
print((b-a+1) - ((b//c-(a-1)//c) + (b//d-(a-1)//d) - (b//lcm(c,d) - (a-1)//lcm(c,d))))

Fixed submission:
import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

a,b,c,d=map(int,input().split())
print((b-a+1) - ((b//c-(a-1)//c) + (b//d-(a-1)//d) - (b//lcm(c,d) - (a-1)//lcm(c,d))))

Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d=map(int,input().split())
print((b-a+1) - ((b//c-(a-1)//c) + (b//d-(a-1)//d) - (b//lcm(c,d) - (a-1)//lcm(c,d))))
def lcm(x, y):
    return (x * y) // math.gcd(x, y)


Fixed submission:
import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

a,b,c,d=map(int,input().split())
print((b-a+1) - ((b//c-(a-1)//c) + (b//d-(a-1)//d) - (b//lcm(c,d) - (a-1)//lcm(c,d))))

Buggy python submission (verdict: Runtime Error):
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

a,b,c,d=map(int,input().split())
print((b-a+1) - ((b//c-(a-1)//c) + (b//d-(a-1)//d) - (b//lcm(c,d) - (a-1)//lcm(c,d))))

Fixed submission:
import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

a,b,c,d=map(int,input().split())
print((b-a+1) - ((b//c-(a-1)//c) + (b//d-(a-1)//d) - (b//lcm(c,d) - (a-1)//lcm(c,d))))
Buggy python submission (verdict: Runtime Error):
n,a,b = (int(input()) for i in range(3))
t=0
for i in range(1,n+1):
    orign=i
    total = 0
    for ii in range(len(str(i))):
        total += i%10
        i=int(i/10)
    if total>=a and total<=b:
        t+=orign
print(t)

Fixed submission:
n,a,b = map(int, input().split())
t=0
for i in range(1,n+1):
    orign=i
    total = 0
    for ii in range(len(str(i))):
        total += i%10
        i=int(i/10)
    if total>=a and total<=b:
        t+=orign
print(t)

Buggy python submission (verdict: Runtime Error):
n,a,b = [int(input()) for i in range(3)]
t=0
for i in range(1,n+1):
    orign=i
    total = 0
    for ii in range(len(str(i))):
        total += i%10
        i=int(i/10)
    if total>=a and total<=b:
        t+=orign
print(t)

Fixed submission:
n,a,b = map(int, input().split())
t=0
for i in range(1,n+1):
    orign=i
    total = 0
    for ii in range(len(str(i))):
        total += i%10
        i=int(i/10)
    if total>=a and total<=b:
        t+=orign
print(t)

Buggy python submission (verdict: Runtime Error):
n,a,b = [int(input()) for i in range(3)]
t=0
for i in range(1,n+1):
    orign=i
    total = 0
    for ii in range(len(str(i))):
        total += i%10
        i=int(i/10)
    if total>=a and total<=b:
        t+=orign
print(t)

Fixed submission:
n,a,b = map(int, input().split())
t=0
for i in range(1,n+1):
    orign=i
    total = 0
    for ii in range(len(str(i))):
        total += i%10
        i=int(i/10)
    if total>=a and total<=b:
        t+=orign
print(t)
Buggy python submission (verdict: Runtime Error):
n,m=[int(i) for i in input().split()]
x=[int(i) for i in input().split()]
x.sort()
a=[]
if m==1:
    print("0")
else:
    for i in range(m-1):
        a.append(x[i+1]-x[i])
    a.sort(reverse=True)
    if n==1:
        print(max(x)-min(x))
    else:
        result=0
        for i in range(n-1):
            result+=a[i]
        print(max(x)-min(x)-result)

Fixed submission:
n,m=[int(i) for i in input().split()]
x=[int(i) for i in input().split()]
x.sort()
a=[]
if m==1 or n>=m:
    print("0")
else:
    for i in range(m-1):
        a.append(x[i+1]-x[i])
    a.sort(reverse=True)
    if n==1:
        print(max(x)-min(x))
    else:
        result=0
        for i in range(n-1):
            result+=a[i]
        print(max(x)-min(x)-result)

Buggy python submission (verdict: Runtime Error):
n,m=[int(i) for i in input().split()]
x=[int(i) for i in input().split()]
x.sort()
a=[]
if m==1:
    print("0")
else:
    for i in range(m-1):
        a.append(x[i+1]-x[i])
    a.sort(reverse=True)
    result=0
    for i in range(n-1):
        result+=a[i]
    print(max(x)-min(x)-result)

Fixed submission:
n,m=[int(i) for i in input().split()]
x=[int(i) for i in input().split()]
x.sort()
a=[]
if m==1 or n>=m:
    print("0")
else:
    for i in range(m-1):
        a.append(x[i+1]-x[i])
    a.sort(reverse=True)
    if n==1:
        print(max(x)-min(x))
    else:
        result=0
        for i in range(n-1):
            result+=a[i]
        print(max(x)-min(x)-result)

Buggy python submission (verdict: Runtime Error):
n,m=[int(i) for i in input().split()]
x=[int(i) for i in input().split()]
x.sort()
a=[]
if m==1:
    print("0")
else:
    for i in range(m-1):
        a.append(x[i+1]-x[i])
    a.sort(reverse=True)
    result=0
    print("0")
    for i in range(n-1):
        result+=a[i]
    print(max(x)-min(x)-result)

Fixed submission:
n,m=[int(i) for i in input().split()]
x=[int(i) for i in input().split()]
x.sort()
a=[]
if m==1 or n>=m:
    print("0")
else:
    for i in range(m-1):
        a.append(x[i+1]-x[i])
    a.sort(reverse=True)
    if n==1:
        print(max(x)-min(x))
    else:
        result=0
        for i in range(n-1):
            result+=a[i]
        print(max(x)-min(x)-result)
Buggy python submission (verdict: Runtime Error):
n,x=[int(i) for i in input().split()]
A=["B","P","B"]
B=["P","P"]
for i in range(n):
    ans=A[0]+B[0]+A[1]+B[1]+A[2]
    B[0]=ans
    B[1]=ans
result=0
for i in range(x):
    if ans[i]=="P":
        result+=1
print(result)

Fixed submission:
n,x=[int(i)  for i in input().split()]
a=[1]
p=[1]
for i in range(n):
    a.append(a[i]*2+3)
    p.append(p[i]*2+1)
def f(n,x):
    if n==0:
        if x==0:
            return 0
        else:
            return 1
    elif n>=1:
        if x==1:
            return 0
        elif 1<x<=1+a[n-1]:
            return f(n-1,x-1)
        elif x==a[n-1]+2:
            return p[n-1]+1
        elif 2+a[n-1]<x<=2*a[n-1]+2:
            return p[n-1]+1+f(n-1,x-2-a[n-1])
        else:
            return 2*p[n-1]+1

print(f(n,x))
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=[]
for j in range(N):
    a=[int(i) for i in input().split()]
    A.append(a)
for i in range(0,101):
    for j in range(0,101):
        HH=[]
        P=[]
        for k in range(N):
            if A[k][2]==0:
                if 1>abs(A[k][0]-i)+abs(A[k][1]-j):
                    break
                else:
                    Q=abs(A[k][0]-i)+abs(A[k][1]-j)
                    P.append(Q)
                    if k==N-1:
                        if len(P)==0:
                            print("{} {} {}".format(i,j,HH[0]))
                            break
                        elif H<=max(P):
                            print("{} {} {}".format(i,j,HH[0]))
                        else:
                            break
                    else:
                        continue
            else:
                H=A[k][2]+abs(A[k][0]-i)+abs(A[k][1]-j)
                if len(HH)==0:
                    HH.append(H)
                    continue
                if H in HH:
                    HH.append(H)
                    if k==N-1:
                        if len(P)==0:
                            print("{} {} {}".format(i,j,H))
                        elif H<=max(P):
                            print("{} {} {}".format(i,j,h))
                        else:
                            break
                    else:
                        continue
                else:
                    break

Fixed submission:
N=int(input())
xyh=[]
for i in range(N):
    a=[int(i) for i in input().split()]
    xyh.append(a)
xyh.sort(key=lambda x:x[2],reverse=True)
flag2=True
for i in range(0,101):
    for j in range(0,101):
        flag=True
        H=xyh[0][2]+abs(xyh[0][0]-i)+abs(xyh[0][1]-j)
        for k in range(1,N):
            if xyh[k][2]!=max(0,H-abs(xyh[k][0]-i)-abs(xyh[k][1]-j)):
                flag=False
                break
        if flag==True:
            print("{} {} {}".format(i,j,H))
            flag2=False
            break
    if flag2==False:
        break
Buggy python submission (verdict: Time Limit Exceeded):
N,M=[int(i) for i in input().split()]
a=M//N
A=[]
for i in range(1,a+1):
    if M%i==0:
        A.append(i)
    else:
        continue
print(max(A))

Fixed submission:
import math
A=[]
N,M=[int(i) for i in input().split()]
sqrt=math.sqrt(M)
for i in range(1,int(sqrt)+1):
    if M%i==0:
        A.append(i)
        A.append(M//i)
ans=[1]
for i in A:
    if i*N<=M:
        ans.append(i)
    else:
        continue
print(max(ans))
Buggy python submission (verdict: Runtime Error):
import math
N,X=[int(i) for i in input().split()]
a=[abs(int(i)-X) for i in input().split()]
c=max(a)
for i in range(len(a)):
    c=math.gcd(c,a[i])
print(c)

Fixed submission:
from fractions import gcd
from functools import reduce
 
N,X=map(int, input().split())
x=map(int, input().split())

lis=[abs(j-X) for j in x]

print(reduce(gcd,lis))

Buggy python submission (verdict: Runtime Error):
from functools import reduce
from math import gcd

N,X=map(int, input().split())
x=map(int, input().split())

lis=[abs(j-X) for j in x]

print(reduce(gcd,lis))

Fixed submission:
from fractions import gcd
from functools import reduce
 
N,X=map(int, input().split())
x=map(int, input().split())

lis=[abs(j-X) for j in x]

print(reduce(gcd,lis))

Buggy python submission (verdict: Runtime Error):
from functools import reduce
from math import gcd
 
N,X=[int(i) for i in input().split()]
x=[int(i) for i in input().split()]

lis=[abs(j-X) for j in x]

print(reduce(gcd,lis))

Fixed submission:
from fractions import gcd
from functools import reduce
 
N,X=map(int, input().split())
x=map(int, input().split())

lis=[abs(j-X) for j in x]

print(reduce(gcd,lis))

Buggy python submission (verdict: Runtime Error):
from functools import reduce
from math import gcd
 
N,X=[int(i) for i in input().split()]
x=[int(i) for i in input().split()]

lis=[abs(x[j]-X) for j in range(N)]

print(reduce(gcd,lis))

Fixed submission:
from fractions import gcd
from functools import reduce
 
N,X=map(int, input().split())
x=map(int, input().split())

lis=[abs(j-X) for j in x]

print(reduce(gcd,lis))
Buggy python submission (verdict: Time Limit Exceeded):
S=input()
K=int(input())
while True:
    if S[0]!="1":
        print(S[0])
        break
    else:
        continue

Fixed submission:
S=input()
K=int(input())
t=0
for i in range(len(S)):
    if S[i]!="1":
        print(S[i])
        break
    else:
        t+=1
        if t>=K:
            print("1")
            break
        else:
            continue
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[int(i) for i in input().split()]
s=0
t=0
for i in range(N):
    s+=abs(A[i]-1-i)
    t+=abs(A[i]-i)
if s>t:
    d=0
    while True:
        d-=1
        r=0
        u=0
        for i in range(N):
            r+=abs(A[i]-d-1-i)
            u+=abs(A[i]-d-i)
        if r>u:
            continue
        else:
            print(r)
            break
elif s==t:
    print(s)
else:
    e=0
    while True:
        e+=1
        x=0
        y=0
        for i in range(N):
            x+=abs(A[i]-e-1-i)
            y+=abs(A[i]-e-i)
        if x<y:
            continue
        else:
            print(y)
            break

Fixed submission:
N=int(input())
A=[int(i) for i in input().split()]
u=[]
for i in range(N):
    u.append(A[i]-i)
a=sorted(u)
if len(a)%2==0:
    p=a[len(a)//2]
else:
    p=a[len(a)//2]
ans=0
for j in range(N):
    ans+=abs(a[j]-p)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[int(i) for i in input().split()]
S=[]
d=sum(A)//len(A)+1
for b in range(-d,d):
    s=0
    for i in range(N):
        s+=abs(A[i]-b-i)
    S.append(s)
print(min(S))

Fixed submission:
N=int(input())
A=[int(i) for i in input().split()]
u=[]
for i in range(N):
    u.append(A[i]-i)
a=sorted(u)
if len(a)%2==0:
    p=a[len(a)//2]
else:
    p=a[len(a)//2]
ans=0
for j in range(N):
    ans+=abs(a[j]-p)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[int(i) for i in input().split()]
S=[]
B=[max(A), N]
for b in range(-max(B),max(B)):
    s=0
    for i in range(N):
        s+=abs(A[i]-b-i)
    S.append(s)
print(min(S))

Fixed submission:
N=int(input())
A=[int(i) for i in input().split()]
u=[]
for i in range(N):
    u.append(A[i]-i)
a=sorted(u)
if len(a)%2==0:
    p=a[len(a)//2]
else:
    p=a[len(a)//2]
ans=0
for j in range(N):
    ans+=abs(a[j]-p)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N,K=[int(i) for i in input().split()]
A=[int(i) for i in input().split()]
s=[0 for i in range(200000)]
for i in range(200000):
    t=A.count(i)
    s[i]+=t
s.sort()
s.reverse()
p=0
for i in range(K):
    p+=s[i]
print(N-p)

Fixed submission:
s=0
R=[]
N,K=[int(i) for i in input().split()]
A=[int(i) for i in input().split()]
import collections
c=collections.Counter(A).most_common()
# for i in c.values():
#     R.append(i)
if len(c)>K:
    for i in range(K):
        s+=c[i][1]
    print(N-s)
else:
    print("0")
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
s=False
for i in range(1,3501):
    for j in range(1,3501):
        if (4*i*j-N*i-N*j)==0:
            continue
        else:
            w=(N*i*j)/(4*i*j-N*i-N*j)
            if w%1==0 and w>0:
                p=i
                q=j
                s=True
                break
            else:
                continue
    if s==True:
        break

print("{} {} {}".format(p,q,int(w)))


Fixed submission:
N=int(input())
s=False
for i in range(1,3501):
    for j in range(1,3501):
        if (4*i*j-N*i-N*j)>0:
            w=(N*i*j)/(4*i*j-N*i-N*j)
            if w%1==0:
                p=i
                q=j
                s=True
                break
    if s==True:
        break

print("{} {} {}".format(p,q,int(w)))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
s=False
for i in range(1,3501):
    for j in range(1,3501):
        if (4*i*j-N*i-N*j)==0:
            continue
        else:
            w=(N*i*j)/(4*i*j-N*i-N*j)
            flag=w.is_integer()
            if flag==True and w>0:
                p=i
                q=j
                s=True
                break
            else:
                continue
    if s==True:
        break

print("{} {} {}".format(p,q,int(w)))

Fixed submission:
N=int(input())
s=False
for i in range(1,3501):
    for j in range(1,3501):
        if (4*i*j-N*i-N*j)>0:
            w=(N*i*j)/(4*i*j-N*i-N*j)
            if w%1==0:
                p=i
                q=j
                s=True
                break
    if s==True:
        break

print("{} {} {}".format(p,q,int(w)))
Buggy python submission (verdict: Time Limit Exceeded):
X=int(input())
A=[]
for i in range(1,X+1):
    A.append(i)
    if sum(A)>=X:
        print(i)
        break

Fixed submission:
sum=0
X=int(input())
for i in range(1,X+1):
    sum+=i
    if sum>=X:
        print(i)
        break
Buggy python submission (verdict: Time Limit Exceeded):
K,S=[int(i) for i in input().split()]
s=0
for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if x+y+z==S:
                s+=1
print(s)

Fixed submission:
K,S=[int(i) for i in input().split()]
s=0
for x in range(K+1):
    for y in range(K+1):
        z=S-x-y
        if 0<=z and z<=K:
            s+=1
print(s)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

s = list(str(input()))
t = list(str(input()))

for i in itertools.permutations(s):
    for j in itertools.permutations(t):
        if "".join(i) < "".join(j):
            print("Yes")
            quit(0)
        else:
            continue

print("No")

Fixed submission:
s = "".join(sorted(input()))
t = "".join(sorted((input()))[::-1])
if s < t:
    print("Yes")
else:
    print("No")

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

s = list(str(input()))
t = list(str(input()))
s_all = ["".join(i) for i in itertools.permutations(s)]
t_all = ["".join(j) for j in itertools.permutations(t)]

for k in s_all:
    for l in t_all:
        if k < l:
            print("Yes")
            quit(0)
        else:
            continue

print("No")


Fixed submission:
s = "".join(sorted(input()))
t = "".join(sorted((input()))[::-1])
if s < t:
    print("Yes")
else:
    print("No")

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

s = list(str(input()))
t = list(str(input()))
s_all, t_all = [], []

for i in itertools.permutations(s):
    s_all.append("".join(i))

for j in itertools.permutations(t):
    t_all.append("".join(j))

for k in s_all:
    for l in t_all:
        if k < l:
            print("Yes")
            quit(0)
        else:
            continue

print("No")


Fixed submission:
s = "".join(sorted(input()))
t = "".join(sorted((input()))[::-1])
if s < t:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
s=input()

if s='SUN':
    ans='7'
elif s='MON':
    ans='6'
elif s='TUE':
    ans='5'
elif s='WED':
    ans='4'
elif s='THU':
    ans='3'
elif s='FRI':
    ans='2'
elif s='SAT':
    ans='1'

print(ans)

Fixed submission:
s=input()

if s=='SUN':
    ans='7'
elif s=='MON':
    ans='6'
elif s=='TUE':
    ans='5'
elif s=='WED':
    ans='4'
elif s=='THU':
    ans='3'
elif s=='FRI':
    ans='2'
elif s=='SAT':
    ans='1'

print(ans)
Buggy python submission (verdict: Runtime Error):
predict = input()
real = input()
cnt = 0

for i,j in zip(predict, real):
  if i == j:
    cnt += 1
    
print(cnt
  

Fixed submission:
predict = input()
real = input()
cnt = 0
 
for i,j in zip(predict, real):
  if i == j:
    cnt += 1
    
print(cnt)
Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = 0

for i in range(N):
  A = int(input())
  ans += 1//A
  
ans = 1//ans

print(ans)
  

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 0

for i in range(N):
  ans += 1/A[i]
  
ans = 1/ans
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = 0

for i in range(N):
  A = int(input())
  ans += 1/A
  
ans = 1/ans

print(ans)
  

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 0

for i in range(N):
  ans += 1/A[i]
  
ans = 1/ans
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = 0

for i in range(N):
  A = int(input())
  ans += 1/A
  
ans = 1/ans

print(ans
  

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 0

for i in range(N):
  ans += 1/A[i]
  
ans = 1/ans
print(ans)
Buggy python submission (verdict: Runtime Error):
week_cicle = ["SUN, "MON", "TUE", "WED", "THU", "FRI", "SAT"]
day_of_week = input()
first = week_cicle.index(day_of_week)
print(7 - first)


Fixed submission:
week_cicle = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]
day_of_week = input()
first = week_cicle.index(day_of_week)
print(7 - first)
Buggy python submission (verdict: Runtime Error):
num = map(int, input().split())
seki = num[0] * num[1]
if seki % 2 == 0:
    print(Even)
else:
    print(Odd)


Fixed submission:
num1, num2 = map(int, input().split())
seki = num1 * num2
if seki % 2 == 0:
    print("Even")
else:
    print("Odd")

Buggy python submission (verdict: Runtime Error):
num = map(int, input().split())
seki = num[0] * num[1]
if seki % 2 == 0:
    print("Even")
else:
    print("Odd")

Fixed submission:
num1, num2 = map(int, input().split())
seki = num1 * num2
if seki % 2 == 0:
    print("Even")
else:
    print("Odd")

Buggy python submission (verdict: Runtime Error):
input_num = map(int, input().split())
seki = input_num[0] * input_num[1]
if seki % 2 == 0:
    print("Even")
else:
    print("Odd")


Fixed submission:
num1, num2 = map(int, input().split())
seki = num1 * num2
if seki % 2 == 0:
    print("Even")
else:
    print("Odd")

Buggy python submission (verdict: Runtime Error):
input_num = map(int, input().split())
seki = input_num[0] * input_num[1]
if seki % 2 == 0:
    print("Even")
else:
    print("0dd")

Fixed submission:
num1, num2 = map(int, input().split())
seki = num1 * num2
if seki % 2 == 0:
    print("Even")
else:
    print("Odd")

Buggy python submission (verdict: Runtime Error):
input_num = map(int, input().split())
seki = input_num[0] * input_num[1]
if seki % 2 == 0:
    print("Even")
else:
    print("Odd")

Fixed submission:
num1, num2 = map(int, input().split())
seki = num1 * num2
if seki % 2 == 0:
    print("Even")
else:
    print("Odd")

Buggy python submission (verdict: Runtime Error):
input_num = map(int, input().split())
seki = input_num[0] * input_num[1]
if seki % 2 == 0:
    print("EvenW\")
else:
    print("Odd")

Fixed submission:
num1, num2 = map(int, input().split())
seki = num1 * num2
if seki % 2 == 0:
    print("Even")
else:
    print("Odd")
Buggy python submission (verdict: Runtime Error):
_ = int(input())

num_list = list(map(int, input().split()))

count = 0
is_all_even = None 
while True:
    for num in num_list:
        if num % 2 != 0:
            is_all_even = False
            break
    if is_all_even is not None:
        break
    count += 1
    num_list = list(map(lambda x: x / 2, num_list))
print(count)







Fixed submission:
num = input()
cnt = 0
for i in num:
    if i == "1":
        cnt += 1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
input_n = int(input())
num_list = [int(i) for i in (input().split())]

count = 0
while True:
    if all(i % 2 == 0 for i in num_list):
        nom_list = map(lambda x: x / 2, num_list)
        count += 1
    else:
        break
print(count)

Fixed submission:
_ = int(input())

num_list = list(map(int, input().split()))

count = 0
is_all_even = None 
while True:
    for num in num_list:
        if num % 2 != 0:
            is_all_even = False
            break
    if is_all_even is not None:
        break
    count += 1
    num_list = list(map(lambda x: x / 2, num_list))
print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = set()

for _ in range(n):
    a = int(input())

    if a in l:
        l.remove(a)
    else:
        l.append(a)

print(len(l))


Fixed submission:
n = int(input())
l = set()

for _ in range(n):
    a = int(input())

    if a in l:
        l.remove(a)
    else:
        l.add(a)

print(len(l))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []

for _ in range(n):
    a = int(input())

    if a in l:
        l.remove(a)
    else:
        l.append(a)

print(len(l))


Fixed submission:
n = int(input())
l = set()

for _ in range(n):
    a = int(input())

    if a in l:
        l.remove(a)
    else:
        l.add(a)

print(len(l))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(input())
b = []
cou1=0

for i in a:
    if i=="(":
        cou1 += 1
        b.append("(")
    else:
        b.append(")")
        if cou1==0:
            b.insert(0,"(")
            continue
        cou1 -= 1

for _ in range(cou1):
    b.append(")")

print(*b,sep='')n = int(input())
a = list(input())
b = []
cou1=0

for i in a:
    if i=="(":
        cou1 += 1
        b.append("(")
    else:
        b.append(")")
        if cou1==0:
            b.insert(0,"(")
            continue
        cou1 -= 1

for _ in range(cou1):
    b.append(")")

print(*b,sep='')

Fixed submission:
n = int(input())
a = list(input())
b = []
cou1=0

for i in a:
    if i=="(":
        cou1 += 1
        b.append("(")
    else:
        b.append(")")
        if cou1==0:
            b.insert(0,"(")
            continue
        cou1 -= 1

for _ in range(cou1):
    b.append(")")

print(*b,sep='')
Buggy python submission (verdict: Runtime Error):
import itertools

n = int(input())
t = list(map(int,input().split()))

print(sum(x*y for x, y in itertools.combinations(t, 2)))


Fixed submission:
a, b = map(int, input().split())
print(a - 2*b) if a - 2*b > 0 else print(0)
Buggy python submission (verdict: Runtime Error):
n, k = list(map(int,input().split()))
h = list(map(int,input().split()))
print(sum([map(lambda x: 1 if x - k >= 0 else 0, h)]))


Fixed submission:
n, k = list(map(int,input().split()))
h = list(map(int,input().split()))
print(sum(list(map(lambda x: 1 if x - k >= 0 else 0, h))))
Buggy python submission (verdict: Runtime Error):
r = input()
print ( r * r )

Fixed submission:
r = int(input())
print (r*r)