Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N,Q = map(int,input().split())
S = list(input())
LR = [tuple(map(int,input().split())) for _ in range(Q)]

C = [0 for _ in range(N+1)]
#C[i]:i文字目までで"AC"が出てくる回数
for i in range(N):
    if S[i] == "A" and S[i+1] == "C":
        C[i+2] += 1

for i in range(N):
    C[i+1] += C[i]

for l,r in LR:
    print(C[r]-C[l])


Fixed submission:
N,Q = map(int,input().split())
S = list(input())
S = ["_"]+S
LR = [tuple(map(int,input().split())) for _ in range(Q)]

C = [0 for _ in range(N+1)]
#C[i]:i文字目までで"AC"が出てくる回数
for i in range(1,N):
    if S[i] == "A" and S[i+1] == "C":
        C[i+1] += 1

for i in range(N):
    C[i+1] += C[i]


for l,r in LR:
    print(C[r]-C[l])
Buggy python submission (verdict: Runtime Error):
#python D-Partition.py
"""
入力フォーマット
N M

出力:a_1+...+a_N=Mを満たす数列aについてmax(GCD(a_1,...,a_N))
"""
import math
line = list(map(int, input().split(" ")))
N = int(line[0])
M = int(line[1])

#TLE(実行時間制限超過)のコード
"""
for i in range(math.floor(M/N),0,-1):
	tmp = M-i*(N-1)
	if tmp%i==0:
		print(i)
		break
"""

#TLEを何とかしたコード（ポイント：素数判定と同じ要領で探索範囲をO(sqrt(M))にした
for i in range(sqrt(M)):
	tmp = M-(math.floor(M/N)-i)*(N-1)
	if tmp%(math.floor(M/N)-i)==0:
		print((math.floor(M/N)-i))
		break


Fixed submission:
#python Programming_Education.py

n = int(input())

if n==1:
	print("Hello World")
else:
	a = int(input())
	b = int(input())

	print(a+b)
Buggy python submission (verdict: Runtime Error):
#python D-Partition.py
"""
入力フォーマット
N M

出力:a_1+...+a_N=Mを満たす数列aについてmax(GCD(a_1,...,a_N))
"""
import math
line = list(map(int, input().split(" ")))
N = int(line[0])
M = int(line[1])

#TLE(実行時間制限超過)のコード
"""
for i in range(math.floor(M/N),0,-1):
	tmp = M-i*(N-1)
	if tmp%i==0:
		print(i)
		break
"""

#TLEを何とかしたコード（ポイント：素数判定と同じ要領で探索範囲をO(sqrt(M))にした
for i in range(sqrt(M)):
	tmp = M-(math.floor(M/N)-i)*(N-1)
	if tmp%(math.floor(M/N)-i)==0:
		print((math.floor(M/N)-i))
		break


Fixed submission:
from math import sqrt

N,M = map(int,input().split())

divisor = set([])
for i in range(1,int(sqrt(M))+1):
	if M % i == 0:
		if i <= int(M / N):
			divisor.add(i)
		if (M // i) <= int(M / N):
			divisor.add(M // i)

print(max(divisor))

Buggy python submission (verdict: Time Limit Exceeded):
#python D-Partition.py
"""
入力フォーマット
N M

出力:a_1+...+a_N=Mを満たす数列aについてmax(GCD(a_1,...,a_N))
"""
import math
line = list(map(int, input().split(" ")))
N = int(line[0])
M = int(line[1])

for i in range(math.floor(M/N),0,-1):
	tmp = M-i*(N-1)
	if tmp%i==0:
		print(i)
		break


Fixed submission:
from math import sqrt

N,M = map(int,input().split())

divisor = set([])
for i in range(1,int(sqrt(M))+1):
	if M % i == 0:
		if i <= int(M / N):
			divisor.add(i)
		if (M // i) <= int(M / N):
			divisor.add(M // i)

print(max(divisor))
Buggy python submission (verdict: Runtime Error):
from math import gcd

def GCD(A):
    if len(A) == 1:
        return A[0]
    elif len(A) == 2:
        g = gcd(A[0],A[1])
    else:
        g = gcd(A[0],A[1])
        for i in range(2,len(A)):
            g = gcd(g,A[i])
    return g

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

x.sort()
for i in reversed(range(N+1)):
    x[i] -= x[0]

ans = GCD(x)
print(ans)


Fixed submission:
def gcd(a,b):
    if a < b:
        a,b = b,a
    if b == 0:
        return a
    else:
        while True:
            r = a % b
            if r == 0:
                return b
            else:
                a,b = b,r

def GCD(A):
    if len(A) == 1:
        return A[0]
    elif len(A) == 2:
        g = gcd(A[0],A[1])
    else:
        g = gcd(A[0],A[1])
        for i in range(2,len(A)):
            g = gcd(g,A[i])
    return g

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

x.sort()
for i in reversed(range(N+1)):
    x[i] -= x[0]

ans = GCD(x)
print(ans)
Buggy python submission (verdict: Runtime Error):
from math import ceil

def attack(AB,H,N):
    AB.sort(key = lambda x:x[1])
    count = 0
    while H > 0:
        if AB[N-1][1] >= H:
            count += 1
            H = 0
            N -= 1
        elif len(AB) >= 2:
            if AB[N-1][0] >= AB[N-2][1]:
                num = ceil((H-AB[N-1][1])/AB[N-1][0])
                H -= num*AB[N-1][0]
                count += num
            else:
                count += 1
                H -= AB[N-1][1]
                N -= 1
        else:
            num = ceil((H-AB[N-1][1])/AB[N-1][0])
            H -= num*AB[N-1][0]
            count += num

    return count

def main():
    N,H = map(int,input().split())
    AB = [list(map(int,input().split())) for _ in range(N)]

    print(attack(AB,H,N))

if __name__ == "__main__":
    main()


Fixed submission:
from math import ceil

def attack(ab,N,H):
    cut_max = 0
    for i in range(N):
        cut_max = max(cut_max,ab[i][0])

    throw = [ab[i][1] for i in range(N)]
    throw.sort(reverse = True)
    throw.append(0)

    cnt,pt = 0,0
    while H > 0:
        if throw[pt] > cut_max:
            H -= throw[pt]
            cnt += 1
            pt += 1
        else:
            cnt += (ceil(H/cut_max))
            H = 0

    return cnt

def main():
    N,H = map(int,input().split())
    ab = [list(map(int,input().split())) for _ in range(N)]

    print(attack(ab,N,H))

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
def attack(AB,H,N):
    AB.sort(key = lambda x:x[1])
    count = 0
    while H > 0:
        if AB[N-1][1] >= H:
            count += 1
            H = 0
            N -= 1
        elif len(AB) >= 2:
            if AB[N-1][0] >= AB[N-2][1]:
                num = (H-AB[N-1][1])//AB[N-1][0]
                H -= num*AB[N-1][0]
                count += num
                if H > AB[N-1][1]:
                    H -= AB[N-1][0]
                    count += 1
            else:
                count += 1
                H -= AB[N-1][1]
                N -= 1
        else:
            num = (H-AB[N-1][1])//AB[N-1][0]
            H -= num*AB[N-1][0]
            count += num
            if H > AB[N-1][1]:
                H -= AB[N-1][0]
                count += 1

    return count

def main():
    N,H = map(int,input().split())
    AB = [list(map(int,input().split())) for _ in range(N)]

    print(attack(AB,H,N))

if __name__ == "__main__":
    main()


Fixed submission:
from math import ceil

def attack(ab,N,H):
    cut_max = 0
    for i in range(N):
        cut_max = max(cut_max,ab[i][0])

    throw = [ab[i][1] for i in range(N)]
    throw.sort(reverse = True)
    throw.append(0)

    cnt,pt = 0,0
    while H > 0:
        if throw[pt] > cut_max:
            H -= throw[pt]
            cnt += 1
            pt += 1
        else:
            cnt += (ceil(H/cut_max))
            H = 0

    return cnt

def main():
    N,H = map(int,input().split())
    ab = [list(map(int,input().split())) for _ in range(N)]

    print(attack(ab,N,H))

if __name__ == "__main__":
    main()
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()

def b_search_l(B,key):
    #key < B[s]を満たす最小のs
    if key < B[0]:
        return 0
    elif key >= B[N-1]:
        return N-1
    else:
        left,right = 0,N
        while left < right:
            mid = (left+right)//2
            if B[mid] <= key and key < B[mid+1]:
                return mid+1
            elif B[mid] > key:
                right = mid
            else:
                left = mid

def b_search_r(B,key):
    #key > B[t]を満たす最大のt
    if B[0] >= key:
        return 0
    elif B[N-1] < key:
        return N-1
    else:
        left,right = 0,N
        while left < right:
            mid = (left+right)//2
            if B[mid] < key and key <= B[mid+1]:
                return mid
            elif B[mid] >= key:
                right = mid
            else:
                left = mid

ans = 0
for i in range(N):
    for j in range(N):
        if A[i] +1 < C[j]:
            ans += (b_search_r(B,C[j]) - b_search_l(B,A[i])+1)

print(ans)


Fixed submission:
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()

def b_search_l(B,key):
    #key < B[s]を満たすsの個数
    if key < B[0]:
        return N
    elif key >= B[N-1]:
        return 0
    else:
        left,right = 0,N
        while left < right:
            mid = (left+right)//2
            if B[mid] <= key and key < B[mid+1]:
                return N-(mid+1)
            elif B[mid] > key:
                right = mid
            else:
                left = mid

def b_search_r(B,key):
    #key > B[t]を満たすtの個数
    if B[0] >= key:
        return 0
    elif B[N-1] < key:
        return N
    else:
        left,right = 0,N
        while left < right:
            mid = (left+right)//2
            if B[mid] < key and key <= B[mid+1]:
                return mid+1
            elif B[mid] >= key:
                right = mid
            else:
                left = mid

#b_l:keyより多い奴の個数
#b_r:key未満の奴の個数
ans = 0
for i in range(N):
    b_l,b_r = b_search_l(C,B[i]),b_search_r(A,B[i])
    ans += (b_l)*(b_r)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
K,S = map(int,input().split())

C = set([])
for x in range(min(K+1,S+1)):
    for y in range(min(K+1,S-x+1)):
        if 0 <= S-x-y and S-x-y <= K:
            C.add((x,y,S-x-y))

print(len(C))


Fixed submission:
K,S = map(int,input().split())

count = 0
if S % 3 == 0:
    count += 1
for x in range(K):
    if 0 <= S-2*x and S-2*x <= K and x != S-2*x:
        count += 3
for x in range(K):
    for y in range(x+1,K):
        if y >= S-x-y:
            break
        elif 0 <= S-x-y and S-x-y <= K:
            count += 6

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

count = 0
for a in range(1,n+1):
  for b in range(1,(n//a)+1):
    if n-b*a > 0:
      count += 1
print(count)

Fixed submission:
n = int(input())

count = 0
for a in range(1,n):
  count += (n-1)//a

print(count)

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

count = 0
for c in range(1,n+1):
  for a in range(1,n-c+1):
    if (n-c)%a == 0:
      count += 1
      #print(a,(n-c)//a,c)
print(count)

Fixed submission:
n = int(input())

count = 0
for a in range(1,n):
  count += (n-1)//a

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n = int(input())
nums = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
  
if n == 1:
  print(0)
elif n == 2:
  print(2)
else:
  count = 0
  for v in itertools.product(nums, repeat=n):
    check = list(v)
    if "0" in check and "9" in check:
      count += 1
  print(count%(10**9+7))

Fixed submission:
n = int(input())
count = 10**n - 9**n - 9**n +8**n
print(count%(10**9+7))

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

if n == 1:
  print(0)
elif n == 2:
  print(2)
else:
  sn = n*"9"
  count = 0
  for i in range(1,int(sn)+1):
    check = str(i).zfill(n)
    if "0" in check and "9" in check:
      count += 1
  print(count%(10**9+7))

Fixed submission:
n = int(input())
count = 10**n - 9**n - 9**n +8**n
print(count%(10**9+7))

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

if n == 1:
  print(0)
elif n == 2:
  print(2)
else:
  sn = n*"9"
  count = 0
  for i in range(1,int(sn)+1):
    check = str(i).zfill(n)
    if "0" in check and "9" in check:
      count += 1
  print(count)

Fixed submission:
n = int(input())
count = 10**n - 9**n - 9**n +8**n
print(count%(10**9+7))
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()

a = []
for i in range(len(s)-len(t)):
  count = 0
  for j in range(len(t)):
    if t[j] != s[j+i]:
      count += 1
  a.append(count)
  
print(min(a))

Fixed submission:
s = input()
t = input()

a = []
for i in range(len(s)-len(t)+1):
  count = 0
  for j in range(len(t)):
    if t[j] != s[j+i]:
      count += 1
  a.append(count)
  
print(min(a))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
an = [int(num)  for num in input().split()]

answer = 0
for i in range(len(an)):
  answer +=  an[i] * sum(an[i+1:])
print(answer%1000000007)

Fixed submission:
n = int(input())
an = [int(num)  for num in input().split()]

an_total = sum(an)
answer = 0
for i in range(len(an)-1):
  an_total -= an[i]
  answer +=  an[i] * an_total
print(answer%1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
an = [int(num)  for num in input().split()]

sum = 0
for i in range(len(an)):
  for j in range(i+1,len(an)):
    sum +=  an[i]*an[j]
    sum = sum%1000000007
print(sum)

Fixed submission:
n = int(input())
an = [int(num)  for num in input().split()]

an_total = sum(an)
answer = 0
for i in range(len(an)-1):
  an_total -= an[i]
  answer +=  an[i] * an_total
print(answer%1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
an = [int(num)  for num in input().split()]

sum = 0
for i in range(len(an)):
  for j in range(i+1,len(an)):
    sum +=  an[i]*an[j]
print(sum%1000000007)

Fixed submission:
n = int(input())
an = [int(num)  for num in input().split()]

an_total = sum(an)
answer = 0
for i in range(len(an)-1):
  an_total -= an[i]
  answer +=  an[i] * an_total
print(answer%1000000007)
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())

check = False
if k%2 == 0:
  check = True
  
if check == False:
  check_s = "7"
  while(True):
    if int(check_s)%k == 0:
      break
    check_s += "7"
  print(len(check_s))
else :
  print(-1)

Fixed submission:
k = int(input())

answer = -1
x = 7
for index in range(k) :
  if x % k == 0:
    answer = index + 1
    break
  x = (10 * x + 7) % k
  
print(answer)
Buggy python submission (verdict: Runtime Error):
memo = {
        1:"a", 2:"b", 3:"c",4:"d", 5:"e",
        6:"f", 7:"g", 8:"h", 9:"i",10:"j",
       11:"k",12:"l",13:"m",14:"n",15:"o",
       16:"p",17:"q",18:"r",19:"s",20:"t",
       21:"u",22:"v",23:"w",24:"x",25:"y",26:"z"
        }

n = int(input())

def name(n):
    if n <= 26:
        return memo[n]
    
    memo[n] = name(n//26) + name(n%26)

    return memo[n]
  
print(name(n))

Fixed submission:
n = int(input())

def name(n):
  if (n == 0):
    return "";
  n-=1
  return name(n//26) + chr(ord("a")+ n%26)
  
print(name(n))
Buggy python submission (verdict: Runtime Error):
x, n = map(int, input().split())

if n == 0:
  print(x)
else :
  pn = [int(num) for num in input().split()]
  answers = {}
  for i in range(0,101):
    if not i in pn:
      answers[i] = abs(i-x)
  print(min(answers, key=answers.get))

Fixed submission:
x, y = map(int, input().split())

check = True
for i in range(x+1) :
  if (i*2+(x-i)*4) == y :
    print("Yes")
    check = False
    break
  
if check :
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
an = [int(num) for num in input().split()]

answer = an[0]
check = 10**18
for i in range(1,len(an)) :
  answer *= an[i]

if answer <= check:
  print(answer)
else :
  print(-1)

Fixed submission:
import sys

n = int(input())
an = [int(num) for num in input().split()]

if 0 in an :
  print(0)
  sys.exit()

answer = 1
check = 10**18
for i in range(len(an)) :
  answer *= an[i]
  if answer > check:
    print(-1)
    sys.exit()

print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
import math

def gcd(*numbers):
    return reduce(math.gcd, numbers)

k = int(input())

sum = 0
for a in range(1,k+1):
  for b in range(1,k+1):
    for c in range(1,k+1):
      sum += gcd(a, b, c)

print(sum)

Fixed submission:
import math

k = int(input())

sum = 0
for a in range(1,k+1):
  for b in range(1,k+1):
    ab = math.gcd(a,b)
    for c in range(1,k+1):
      sum += math.gcd(ab, c)

print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int , input().split())
hn = [int(num) for num in input().split()]

hn.sort(reverse = True)
for i in range(k):
  if len(hn) > 0:
    hn = hn[1:]
    
print(sum(hn))

Fixed submission:
n, k = map(int , input().split())
hn = [int(num) for num in input().split()]

hn.sort(reverse = True)
if len(hn) > k:
  print(sum(hn[k:]))
else :
  print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int , input().split())
hn = [int(num) for num in input().split()]

hn.sort(reverse = True)
for i in range(k):
  if len(hn) > 0:
    hn.pop(0)
    
print(sum(hn))

Fixed submission:
n, k = map(int , input().split())
hn = [int(num) for num in input().split()]

hn.sort(reverse = True)
if len(hn) > k:
  print(sum(hn[k:]))
else :
  print(0)
Buggy python submission (verdict: Runtime Error):
d = {"SUN":7,"MON":6,"TUE":5,"WEN":4,"THU":3,"FRI":2,"SAT":1}

s = input()
print(d[s])

Fixed submission:
d = {"SUN":7,"MON":6,"TUE":5,"WED":4,"THU":3,"FRI":2,"SAT":1}

s = input()
print(d[s])

Buggy python submission (verdict: Runtime Error):
d = {"SUN":7,"MON":6,"TUE":5,"WEN":4,"THU":3,"FRI":2,"STR":1}

s = input()
print(d[s])

Fixed submission:
d = {"SUN":7,"MON":6,"TUE":5,"WED":4,"THU":3,"FRI":2,"SAT":1}

s = input()
print(d[s])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
an = [int(num) for num in input().split()]

answer = []
for index in range(1,len(an)+1):
  answer.append(str(an.index(index)+1))

print(" ".join(answer))

Fixed submission:
n = int(input())
an = [int(num) for num in input().split()]

answer = [0 for _ in range(n)]
for index in range(n):
  answer[an[index] - 1] = str(index + 1)

print(" ".join(answer))
Buggy python submission (verdict: Runtime Error):
a, b =map(int,input().split())
answer = 1
num = 0
while (answer < b) :
  anwer += a - 1
  num += 1
  
print(num)


Fixed submission:
A, B = map(int, input().split())

ans = 1
i = 0
while ans < B:
    ans += A - 1
    i += 1

print(i)

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

answer = 1
num = 0
while(answer < b):
  anwer += a - 1
  num += 1
    
print(num)


Fixed submission:
A, B = map(int, input().split())

ans = 1
i = 0
while ans < B:
    ans += A - 1
    i += 1

print(i)

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

answer = 1
num = 0
while(answer < b):
  anwer += a - 1
    num += 1
    
print(num)

Fixed submission:
A, B = map(int, input().split())

ans = 1
i = 0
while ans < B:
    ans += A - 1
    i += 1

print(i)

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

answer = 1
num = 0
while(answer < b):
  anwer += a - 1
    num += 1
    
print(num)

Fixed submission:
A, B = map(int, input().split())

ans = 1
i = 0
while ans < B:
    ans += A - 1
    i += 1

print(i)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
an = [int(input()) for _ in range(n)]

for i in range(n):
  if i != n-1 :
    a = an[:i] + an[i+1:]
  else :
    a = an[:i]
  print(max(a))

Fixed submission:
n = int(input())
an = [int(input()) for _ in range(n)]

check = sorted(an, reverse=True)
for i in range(n):
  if an[i] == check[0] :
    print(check[1])
  else :
    print(check[0])
Buggy python submission (verdict: Runtime Error):
n = int(input())
 
l = []
for i in range(n):
    l.append(input())

if len(set(l)) != n :
    print("No")
    exit()

for i in range(n-1) :
    if l[i][-1] != l[i+1][0]:
        print("No")
        exit()

print("Yes")

Fixed submission:
hh, ww = map(int, input().split())
h, w = map(int, input().split())

print(int((hh-h)*(ww-w)))
Buggy python submission (verdict: Runtime Error):
a, b, n = map(int, input().split())

def divisor(num):
    num_l = []
    if (num == 1) :
        return [1]
    else :
        for i in range(1,num):
            if (num % i == 0):
                num_l.append(i)
        return num_l

a_l = divisor(a)
b_l = divisor(b)

two_divisor = []
for c in a_l :
    if c in b_l :
        two_divisor.append(c)

print(two_divisor[n-1])

Fixed submission:
a, b, k = map(int, input().split())
 
num = min(a, b)
answer = []
for i in range(1, num+1):
    if (a % i == 0 and b % i == 0):
        answer.append(i)
        
print(answer[-k])
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

for c in range(1,4) :
    if (a*b*c)%2 == 1 :
        print("Yes")
        sys.exit(0)

print("No")

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

if (a%2 == 1 ) and (b%2 == 1 ) :
    print("Yes")
else :
    print("No")

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

for c in range(1,4) :
    if (a*b*c)%2 == 1 :
        print("Yes")
        sys.exit()

print("No")

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

if (a%2 == 1 ) and (b%2 == 1 ) :
    print("Yes")
else :
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
k = int(input())

count = 0
for i in s:
  if i == "1":
    count += 1
  else :
    count += int(i)**k
  if count >= k:
    print(i)
    break
  

Fixed submission:
s = input()
k = int(input())

answer = 1
if len(s) == 1:
  answer = s
else :
  for i in range(k):
    if s[i] != "1":
      answer = s[i]
      break
print(answer)
Buggy python submission (verdict: Runtime Error):
a = int(input())

if a%n == 2 :
    print(a)
else :
    print(a*2)

Fixed submission:
a = int(input())

if a%2 == 0 :
    print(a)
else :
    print(a*2)
Buggy python submission (verdict: Runtime Error):
print(int(input()/3))

Fixed submission:
a = int(input())
print(int(a/3))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
 
l = []
for i in range(n) :
    a = int(input())
    l.append(a)

l.sort(reverse=False)
count_sum = 0   
for j in set(l):
    count = 0
    for  k in  range(l.index(j),len(l)):
        if l[k] == j :
            count += 1
        else :
            break
    count_sum += count%2

print(count_sum)

Fixed submission:
n = int(input())

answer = {}
for i in range(n):
  ai = int(input())
  if answer.get(ai):
    answer.pop(ai)
  else:
    answer[ai] = 1
    
print(len(answer))

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

l = []
for i in range(n) :
    a = int(input())
    l.append(a)

count = 0   
for j in set(l):
    if l.count(j) %2 == 1 :
         count += 1

print(count)

Fixed submission:
n = int(input())

answer = {}
for i in range(n):
  ai = int(input())
  if answer.get(ai):
    answer.pop(ai)
  else:
    answer[ai] = 1
    
print(len(answer))

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

import sys
a = []
for line in sys.stdin:
    a.append(int(line.rstrip("\n")))

check = []    
for i in set(a):
    if a.count(i) %2 == 1 :
         check.append(i)

print(len(check))

Fixed submission:
n = int(input())

answer = {}
for i in range(n):
  ai = int(input())
  if answer.get(ai):
    answer.pop(ai)
  else:
    answer[ai] = 1
    
print(len(answer))

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

import sys
a = []
for line in sys.stdin:
    a.append(int(line.rstrip("\n")))

check = []    
for i in a:
    if check.count(i) == 0 :
         check.append(i)
    else :
         check.remove(i)

print(len(check))

Fixed submission:
n = int(input())

answer = {}
for i in range(n):
  ai = int(input())
  if answer.get(ai):
    answer.pop(ai)
  else:
    answer[ai] = 1
    
print(len(answer))