Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
x,y,z=input().split()
a=x//(y+z)
b=x%(y+z)
if b>=z:
  print(a)
else:
  print(a-1)

Fixed submission:
X,Y,Z = map(int,input().split())
ans = (X-Z)//(Y+Z)
print(ans)
Buggy python submission (verdict: Runtime Error):
N,M=input().split()

ans=((N-M)*100+M*1900)*pow(2,M)

print(str(ans))


Fixed submission:
N,M=map(int,input().split())

ans=((N-M)*100+M*1900)*pow(2,M)

print(str(ans))
Buggy python submission (verdict: Runtime Error):
a,b=input().split("
                  ")
if (a[0]==b[2] and a[1]==b[1] and a[2]==b[0]):
  print("YES")
else:
  print("NO")


Fixed submission:
a=input()
b=input()
if (a[0]==b[2] and a[1]==b[1] and a[2]==b[0]):
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
a,b=input().split()
if a[0]==b[2] and a[1]==b[1] and a[2]==b[0]:
  print("YES")
else:
  print("NO")

Fixed submission:
a=input()
b=input()
if (a[0]==b[2] and a[1]==b[1] and a[2]==b[0]):
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
import bisect

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort()
b.sort()
c.sort()
A = 0
for x in b:
  i = bisect.bisect_left(a, x)
  j = bisect.bisect_right(c, x)
  if i > 0 and j != len(c):
    ans += i * (n - j)
print(ans)


Fixed submission:
import bisect

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort()
b.sort()
c.sort()
A = 0
for x in b:
  i = bisect.bisect_left(a, x)
  j = bisect.bisect_right(c, x)
  if i > 0 and j != len(c):
    A += i * (n - j)
print(A)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort()
b.sort()
c.sort()
count=0
for i in a:
  for j in b:
    for k in c:
      if i<j<k:
        count=count+1
print(count)
        

Fixed submission:
import bisect

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort()
b.sort()
c.sort()
A = 0
for x in b:
  i = bisect.bisect_left(a, x)
  j = bisect.bisect_right(c, x)
  if i > 0 and j != len(c):
    A += i * (n - j)
print(A)
Buggy python submission (verdict: Runtime Error):
r=input()
g=input()
a=2*g-r
print(a)

Fixed submission:
r=int(input())
g=int(input())
a=2*g-r
print(a)
Buggy python submission (verdict: Runtime Error):
n=int(input())
k=int(input())
a=1
for i in range(1,n+1):
  if a >k:
    a=a+k
  else:
    a=2a
    
    





Fixed submission:
n=int(input())
k=int(input())
a=1
for i in range(0,n):
    if a >k:
        a=a+k
    else:
        a=2*a
print(a)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int(input().split(" ")))
if a==b:
  print(c)
elif a==c:
  print(b)
else:
  print(a)

Fixed submission:
a,b,c=input().split(" ")
if a==b:
  print(c)
elif a==c:
  print(b)
else:
  print(a)
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
s=[input() for i in range(h)]

for i in range(h):
  for j in range(w):
    if s[i][j]=="#":
      continue
    count=0
    
    for dx in [-1,0,1]:
      for dy in [-1,0,1]:
        if 0<=i+dy<h and 0<=j+dx<w and s[i+dy][j+dx]=="#":
          count+=1
    s[i][j]=str(count)
    
for a in s:
  print(''.join(a))



Fixed submission:
H, W = map(int, input().split())
S = [input() for i in range(H)]
offset_h = (-1,-1,-1,0,0,1,1,1)
offset_w = (-1,0,1,-1,1,-1,0,1)
for h in range(H):
  for w in range(W):
    if S[h][w] == "#":
      print("#", end="")
    else:
      bomb = 0
      for i,j in zip(offset_h, offset_w):
        if h+i >= 0 and h+i < H and w+j >=0 and w+j < W and S[h+i][w+j]=="#":
          bomb += 1
            
      print(bomb, end="")
     
  print("")

Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
s=[input() for i in range(h)]

for i in range(h):
  for j in range(w):
    if s[i][j]=="#":
      continue
    count=0
    
    for dx in [-1,0,1]:
      for dy in [-1,0,1]:
        if 0<=i+dy<h and 0<=j+dx<w and s[i+dy][j+dx]=="#":
          count+=1
    s[i][j]=str(count)
    
for a in s:
  print(''.join(a))



Fixed submission:
H, W = map(int, input().split())
S = [input() for i in range(H)]
offset_h = (-1,-1,-1,0,0,1,1,1)
offset_w = (-1,0,1,-1,1,-1,0,1)
for h in range(H):
  for w in range(W):
    if S[h][w] == "#":
      print("#", end="")
    else:
      bomb = 0
      for i,j in zip(offset_h, offset_w):
        if h+i >= 0 and h+i < H and w+j >=0 and w+j < W and S[h+i][w+j]=="#":
          bomb += 1
            
      print(bomb, end="")
     
  print("")
Buggy python submission (verdict: Runtime Error):
n=int(input())
k=int(input())
l=[int(x) for x in input().split()]
s=0
for i in range(n):
  if abs(l[i]-k)>abs(l[i]):
    s+=abs(l[i])
  else:
    s+=abs(l[i]-k)
print(s*2)
  


Fixed submission:
n,a=(int(input()) for _ in range(2))
print(n**2-a)
Buggy python submission (verdict: Runtime Error):
n=int(input())
if n[0]==9 or n[1]==9:
  print("Yes")
else:
  print("No")

Fixed submission:
n=input()
if n[0]=="9" or n[1]=="9":
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
l=input()
n=(len(l)+1)//2
for i in range(n):
  odd+=l[2*i]
print(odd)

Fixed submission:
l=input()
n=(len(l)+1)//2
odd=""
for i in range(n):
  odd+=l[2*i]
print(odd)
Buggy python submission (verdict: Runtime Error):
import string
x=input()
a=string.acsii_lowercase
for i in a:
  if i not in x:
    print(i)
    exit()
print("None")


Fixed submission:
import string
S = str(input())
a = set(S)
b = set(string.ascii_lowercase)
c = b - a
if len(list(c)) == 0:
    print(None)
else:
    print(sorted(list(c))[0])

Buggy python submission (verdict: Runtime Error):
import string
x=input()
a=string.acsii_lowercase
for i in a
  if i not in x:
    print(i)
    exit()
print("None")


Fixed submission:
import string
S = str(input())
a = set(S)
b = set(string.ascii_lowercase)
c = b - a
if len(list(c)) == 0:
    print(None)
else:
    print(sorted(list(c))[0])

Buggy python submission (verdict: Runtime Error):
import string
x=input()
a=string.acsii_lowercase
for i in a
  if a not in x:
    print(x)
    exit()


Fixed submission:
import string
S = str(input())
a = set(S)
b = set(string.ascii_lowercase)
c = b - a
if len(list(c)) == 0:
    print(None)
else:
    print(sorted(list(c))[0])
Buggy python submission (verdict: Runtime Error):
n, k = list(map(int, input().split()))
l=[int(x) for x in input().split()]
l.sort()
l.reverse()
print(sum(l[0:K]))


Fixed submission:
n, k = list(map(int, input().split()))
l=[int(x) for x in input().split()]
l.sort()
l.reverse()
print(sum(l[0:k]))

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
l=[int(i) for i in input().split()]
a=sorted(l)
for j in range(k):
  s+=a[-(j+1):]
print(s)

Fixed submission:
n, k = list(map(int, input().split()))
l=[int(x) for x in input().split()]
l.sort()
l.reverse()
print(sum(l[0:k]))
Buggy python submission (verdict: Runtime Error):
l=(int(input().split()))
b=sorted(l)
print(b[0]+b[1])

Fixed submission:
a, b, c = map(int, input().split())
print(min(a+b,a+c,b+c))
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
for _ in range(100):
  if (a*i)%b==c:
    print("YES")
    break
  else:
    pass

Fixed submission:
a,b,c=map(int,input().split())
for i in range(100):
  if (a*i)%b==c:
    print("YES")
    exit()
print("NO")
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a+b<24:
  print(a+b)
else:
  print(a+b-24

Fixed submission:
a,b=map(int,input().split())
if a+b<24:
  print(a+b)
else:
  print(a+b-24)
Buggy python submission (verdict: Runtime Error):
w,a,b=map(int,input().split())
print(min(abs(a+w-B),abs(b+w-a)))

Fixed submission:
W, a, b = map(int, input().split())
r = min(a,b)
l = max(a,b)
print(0 if (r+W)>=l else l-(r+W))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
m=1
for i in range(1,n+1):
  m*=i
print(m%1000000007)


Fixed submission:
import math
n = int(input())
print(math.factorial(n) % (10**9+7))

Buggy python submission (verdict: Runtime Error):
n=int(input())
for i in range(1,n+1):
  m*=i
print(m%1000000007)

Fixed submission:
import math
n = int(input())
print(math.factorial(n) % (10**9+7))
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input()
l=[0]*n
for i in range(n-1):
  if s[i]==I:
    l[i+1]=l[i]+1
  else:
    l[i+1]=i[i]-1
print(max(l))
    


Fixed submission:
n=int(input())
s=input()
i=0
m=i
for c in s:
	if c == 'I':
		i+=1
	else:
		i-=1
	m=max(m,i)
print(m)

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input()
l=[0]*n
for i in range(n):
  if s[i]==I:
    l[i]+=1
  else:
    l[i]-=1
print(max(l))
    

Fixed submission:
n=int(input())
s=input()
i=0
m=i
for c in s:
	if c == 'I':
		i+=1
	else:
		i-=1
	m=max(m,i)
print(m)
Buggy python submission (verdict: Runtime Error):
a,b,c=input().split(,)
print(a+" "+b+" "+c)

Fixed submission:
s = input().split(',')
s = ' '.join(s)
print(s)
Buggy python submission (verdict: Time Limit Exceeded):
k,s=map(int, input().split())
t=0
for i in range(k+1):
    for j in range(k+1):
        if 0<=i<=k and 0<=j<=k and 0<=s-i-j<=k:
            t+=1
print(t)


Fixed submission:
k,s=map(int,input().split())
c=0
for i in range(k+1):
  for j in range(k+1):
    if(s-i-j>=0 and s-i-j<=k):
      c+=1
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
k,s=map(int, input().split())
t=0
for i in range(k+1):
    for j in range(k+1):
        if 0<=i<=k and 0<=j<=k and 0<=s-i-j<=k:
            t+=1
print(t)


Fixed submission:
k,s=map(int,input().split())
c=0
for i in range(k+1):
  for j in range(k+1):
    if(s-i-j>=0 and s-i-j<=k):
      c+=1
print(c)
Buggy python submission (verdict: Runtime Error):
a,b,c=input().split()
a,c=int(a),int(c)
print(abc)

Fixed submission:
print(eval(input()))
Buggy python submission (verdict: Runtime Error):
a=[int(input()) for _ in range(3)]
b=sorted(a)
if b[0]==5 and b[1]==5 and b[2]==7:
  print("YES")
else:
  print("NO")


Fixed submission:
a=list(map(int,input().split()))
print(['NO','YES'][a.count(5)==2 and a.count(7)==1])

Buggy python submission (verdict: Runtime Error):
a=[int(input()) for _ in range(3)]
a.sort()
if a[0]==5 and a[1]==5 and a[2]==7:
  print("YES")
else:
  print("NO")


Fixed submission:
a=list(map(int,input().split()))
print(['NO','YES'][a.count(5)==2 and a.count(7)==1])

Buggy python submission (verdict: Runtime Error):
a=[int(input()) for _ in range(3)]
if sorted(a)==[5,5,7]:
  print("YES")
else:
  print("NO")


Fixed submission:
a=list(map(int,input().split()))
print(['NO','YES'][a.count(5)==2 and a.count(7)==1])

Buggy python submission (verdict: Runtime Error):
a=[int(input()) for _ in range()]
if sorted(a)==[5,5,7]:
  print("YES")
else:
  print("NO")


Fixed submission:
a=list(map(int,input().split()))
print(['NO','YES'][a.count(5)==2 and a.count(7)==1])
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
from collections import Counter

N,M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]

LR = reduce(lambda a,b:a+[a[-1]+b],A,[0])
LR = list(map(lambda x:x%M,LR))

Lc = Counter(LR[:-1])
Rc = Counter(LR[1:])
LRCount = Counter(LR)
LRNum = [int(LRCount[k]*(LRCount[k]-1)/2) for k in LRCount]

LRNum = sum(LRNum)
print(LRNum)

Fixed submission:
from functools import reduce
from collections import Counter


def calc(N,M,A):
    LR = [0]
    pa = 0
    for a in A:
        pa += a
        LR.append(pa)
    LR = list(map(lambda x:x%M,LR))

    LRCount = Counter(LR)
    LRNum = [int(LRCount[k]*(LRCount[k]-1)/2) for k in LRCount]
    LRNum = sum(LRNum)
    print(LRNum)

N,M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
calc(N,M,A)
Buggy python submission (verdict: Runtime Error):
for i in a:
    while i%2==0:
        i/=2
        ans+=1

print(ans)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans=0

for i in a:
    while i%2==0:
        i/=2
        ans+=1

print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
dp=[float("inf")]*100010
dp[0]=0

for i in range(n+1):
    power = 1
    while power <= n:
        dp[i + power] = min(dp[i + power],dp[i] + 1)
        power *= 6
    power = 1
    while power <= n:
        dp[i + power] = min(dp[i + power],dp[i] + 1)
        power *= 9

print(dp[n])

Fixed submission:
N=int(input())
dp=[float('inf')]*100010
dp[0]=0
base=[1, 6, 36, 216, 1296, 7776, 46656, 9, 81, 729, 6561, 59049]


for i in range(N+1):
    for power in base:
        dp[i]=min(dp[i],dp[i-power]+1)

print(dp[N])

Buggy python submission (verdict: Runtime Error):
n=int(input())
dp=[float("inf")]*100010
dp[0]=0

for i in range(n):
    power = 1
    while power <= n:
        dp[i + power] = min(dp[i + power],dp[i] + 1)
        power *= 6
    power = 1
    while power <= n:
        dp[i + power] = min(dp[i + power],dp[i] + 1)
        power *= 9

print(dp[n])

Fixed submission:
N=int(input())
dp=[float('inf')]*100010
dp[0]=0
base=[1, 6, 36, 216, 1296, 7776, 46656, 9, 81, 729, 6561, 59049]


for i in range(N+1):
    for power in base:
        dp[i]=min(dp[i],dp[i-power]+1)

print(dp[N])

Buggy python submission (verdict: Runtime Error):
n=int(input())
dp=[float("inf")]*100000
dp[0]=0

for i in range(n):
    power = 1
    while power <= n:
        dp[i + power] = min(dp[i + power],dp[i] + 1)
        power *= 6
    power = 1
    while power <= n:
        dp[i + power] = min(dp[i + power],dp[i] + 1)
        power *= 9

print(dp[n])

Fixed submission:
N=int(input())
dp=[float('inf')]*100010
dp[0]=0
base=[1, 6, 36, 216, 1296, 7776, 46656, 9, 81, 729, 6561, 59049]


for i in range(N+1):
    for power in base:
        dp[i]=min(dp[i],dp[i-power]+1)

print(dp[N])
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=list(input())
ans=3000000

for i in range(n):
    counts=0
    counts=s[:i].count("W")
    counts=counts+s[i+1:].count("E")
    ans=min(ans,counts)
print(ans)

Fixed submission:
n=int(input())
s=list(input())
count_east=[0]*n
count_west=[0]*n
counts=[0]*n

for i in range(n-2,-1,-1):
    if s[i+1]=='E':
        count_east[i]=count_east[i+1]+1
    else:
        count_east[i]=count_east[i+1]
for i in range(1,n):
    if s[i-1]=='W':
        count_west[i]=count_west[i-1]+1
    else:
        count_west[i]=count_west[i-1]
for i in range(n):
    counts[i]=count_east[i]+count_west[i]

print(min(counts))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=list(input())
ans=300000

for i in range(n):
    count=0
    for j in range(i):
        if s[j]=="W":
            count+=1
    for j in range(i+1,n):
        if s[j]=="E":
            count+=1
    ans=min(ans,count)
print(ans)

Fixed submission:
n=int(input())
s=list(input())
count_east=[0]*n
count_west=[0]*n
counts=[0]*n

for i in range(n-2,-1,-1):
    if s[i+1]=='E':
        count_east[i]=count_east[i+1]+1
    else:
        count_east[i]=count_east[i+1]
for i in range(1,n):
    if s[i-1]=='W':
        count_west[i]=count_west[i-1]+1
    else:
        count_west[i]=count_west[i-1]
for i in range(n):
    counts[i]=count_east[i]+count_west[i]

print(min(counts))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
X=list(map(int,input().split()))
list=sorted(X)

for i in X:
    if list.index(i)<N/2:
        print(list[N//2])
    else:
        print(list[N//2-1])

Fixed submission:
N=int(input())
X=list(map(int,input().split()))
list=sorted(X)

for i in range(N):
    if list[int((N/2))]<=X[i]:
        print(list[int(N/2)-1])
    else:
        print(list[int(N/2)])

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
X=list(map(int,input().split()))
list=sorted(X)

for i in X:
    list.remove(i)
    print(list[N//2-1])
    list.append(i)
    list.sort()


Fixed submission:
N=int(input())
X=list(map(int,input().split()))
list=sorted(X)

for i in range(N):
    if list[int((N/2))]<=X[i]:
        print(list[int(N/2)-1])
    else:
        print(list[int(N/2)])

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
X=list(map(int,input().split()))

for i in range(N):
    del_num = X[i:i + 1]
    X.pop(i)
    list1 = sorted(X)
    print(list1[N // 2-1])
    X.insert(i, int(del_num[0]))

Fixed submission:
N=int(input())
X=list(map(int,input().split()))
list=sorted(X)

for i in range(N):
    if list[int((N/2))]<=X[i]:
        print(list[int(N/2)-1])
    else:
        print(list[int(N/2)])
Buggy python submission (verdict: Runtime Error):
import math
import numpy

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

max_num=max(a)
middle_num=math.ceil(max_num/2)
middle_num_up=middle_num
middle_num_down=middle_num

if n>2:
    while True:
        if middle_num_up in a:
            ans=middle_num_up
            break
        if middle_num_down in a:
            ans=middle_num_down
            break
        else:
            middle_num_up+=1
            middle_num_down-=1
else:
    ans=min(a)

print("{} {}".format(max_num,ans)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a=sorted(a)

max_num=max(a)
middle_num=max_num/2
num=0

for i in range(n):
    if a[i]> middle_num:
        num=i
        break

if middle_num-a[num-1]<=-middle_num+a[num]:
    print("{} {}".format(max_num,a[num-1]))
else:
    print("{} {}".format(max_num,a[num]))

Buggy python submission (verdict: Runtime Error):
import math
import numpy

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

max_num=max(a)
middle_num=math.ceil(max_num/2)
middle_num_up=middle_num
middle_num_down=middle_num

if n>2:
    while True:
        if middle_num_up in a:
            ans=middle_num_up
            break
        if middle_num_down in a:
            ans=middle_num_down
            break
        else:
            middle_num_up+=1
            middle_num_down-=1
else:
    ans=min(a)

print("{} {}".format(max_num,ans)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a=sorted(a)

max_num=max(a)
middle_num=max_num/2
num=0

for i in range(n):
    if a[i]> middle_num:
        num=i
        break

if middle_num-a[num-1]<=-middle_num+a[num]:
    print("{} {}".format(max_num,a[num-1]))
else:
    print("{} {}".format(max_num,a[num]))

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

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

max_num=max(a)
middle_num=math.ceil(max_num/2)
middle_num_up=middle_num
middle_num_down=middle_num

if n>2:
    for i in range(n):
        if middle_num_up in a:
            ans=middle_num_up
            break
        if middle_num_down in a:
            ans=middle_num_down
        else:
            middle_num_up+=1
            middle_num_down-=1
else:
    ans=min(a)

print("{} {}".format(max_num,ans))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a=sorted(a)

max_num=max(a)
middle_num=max_num/2
num=0

for i in range(n):
    if a[i]> middle_num:
        num=i
        break

if middle_num-a[num-1]<=-middle_num+a[num]:
    print("{} {}".format(max_num,a[num-1]))
else:
    print("{} {}".format(max_num,a[num]))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
A.insert(0,0)
A.append(0)
ans=0

for i in range(1,N+1):
    for j in range(1, N + 2, 1):
        ans += abs(A[j] - A[j - 1])
    if A[i+1]<A[i-1]:
        if A[i-1]<A[i]:
            ans-=2*abs(A[i-1]-A[i])
        if A[i]<A[i+1]:
            ans-=2*abs(A[i+1]-A[i])
    if A[i-1]<A[i+1]:
        if A[i+1]<A[i]:
            ans-=2*abs(A[i]-A[i+1])
        if A[i]<A[i-1]:
            ans-=2*abs(A[i-1]-A[i])
    print(ans)
    ans=0

Fixed submission:
n = int(input())
a = list(map(int,input().split()))

list=[0]
list += a
list += [0]

sum=0
for i in range(n+1):
    sum += abs(list[i] - list[i+1])

for i in range(1,n+1):
    ans = 0
    ans = sum - abs(list[i] - list[i - 1]) -abs(list[i + 1] - list[i]) + abs(list[i + 1] - list[i - 1])
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Here your code !

N = int(input())
list = []
for i in range(N):
    x = input()
    if x in list :
        list.remove(x)
    else :
        list.append(x)
print(len(list))

Fixed submission:
N = int(input())
card = set()

for i in range(N):
    A = int(input())
    if A in card:
        card.remove(A)
    else:
        card.add(A)
print(len(card))

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Here your code !
list = []
for i in range(1000):
    list.append(0)
N = int(input())
for i in range(N):
    a = int(input())
    if list[a - 1] == 0:
        list[a-1] = 1
    else:
        list[a-1] = 0
print(list.count(1))

Fixed submission:
N = int(input())
card = set()

for i in range(N):
    A = int(input())
    if A in card:
        card.remove(A)
    else:
        card.add(A)
print(len(card))

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Here your code !
list = []
for i in range(1000000000):
    list.append(0)
N = int(input())
for i in range(N):
    a = int(input())
    if list[a - 1] == 0:
        list[a-1] = 1
    else:
        list[a-1] = 0
print(list.count(1))

Fixed submission:
N = int(input())
card = set()

for i in range(N):
    A = int(input())
    if A in card:
        card.remove(A)
    else:
        card.add(A)
print(len(card))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
ans = [0]*max(A)

if N ==1:
    ans[0] = 1
else:
    for X in range(max(A)):
        for i in range(N):
            if abs(X-A[i])<=1:
                ans[X]+=1

print(max(ans))

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
ans = [0]*(10**5+3)

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

print(max(ans))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
ans = [0]*N

if N ==1:
    ans[0] = 1
else:
    for X in range(N):
        for i in range(N):
            if abs(X-A[i])<=1:
                ans[X]+=1

print(max(ans))

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
ans = [0]*(10**5+3)

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

print(max(ans))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(map(int,input().split()))
if N>2:
    x = [0]*(N-2)
    for i in range(N-2):
        x[i] = a.count(i) + a.count(i+1) + a.count(i+2)
    print(max(x))
elif N == 2:
    if a[0] == a[1] or a[0] == a[1] +1 or a[0] == a[1] -1  :
        print(2)
    else:
        print(1)
else:
    print(1)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
ans = [0]*(10**5+3)

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

print(max(ans))
Buggy python submission (verdict: Runtime Error):
N = int(input())
T= [0]*N
for i in range(N):
    T[i] = int(input())
T.sort(reverse=True)
def gcd(n,m):
    while m != 0:
        n , m = m , n%m
    return n
def lcm(n,m):
     x = (n/gcd(n,m))*m
     return int(x)
ans = T[0]
for i in range(1,N):
    ans = lcm(ans,T[i])
print(ans)


Fixed submission:
N = int(input())
T= [0]*N
for i in range(N):
    T[i] = int(input())
T.sort(reverse=True)
def gcd(n,m):
    while m > 0:
        n , m = m , n%m
    return n
def lcm(n,m):
     x = n*m//gcd(n,m)
     return x
for i in range(N-1):
    T[i+1] = lcm(T[i],T[i+1])
print(T[N-1])