Problem:


Score : 300 points

Problem Statement

You are playing the following game with Joisino.

Initially, you have a blank sheet of paper.

Joisino announces a number. If that number is written on the sheet, erase the number from the sheet; if not, write the number on the sheet. This process is repeated N times.

Then, you are asked a question: How many numbers are written on the sheet now?

The numbers announced by Joisino are given as A_1, ... ,A_N in the order she announces them. How many numbers will be written on the sheet at the end of the game?

Constraints

1≤N≤100000

1≤A_i≤1000000000(=10^9)

All input values are integers.

Input

Input is given from Standard Input in the following format:

N
A_1
:
A_N

Output

Print how many numbers will be written on the sheet at the end of the game.

Sample Input 1

3
6
2
6

Sample Output 1

1

The game proceeds as follows:

6 is not written on the sheet, so write 6.

2 is not written on the sheet, so write 2.

6 is written on the sheet, so erase 6.

Thus, the sheet contains only 2 in the end. The answer is 1.

Sample Input 2

4
2
5
5
2

Sample Output 2

0

It is possible that no number is written on the sheet in the end.

Sample Input 3

6
12
22
16
22
18
12

Sample Output 3

2



Sample input:
3
6
2
6


Sample output:
1

Submission status: Accepted

Solution code:
n=int(input())
d={}
for x in range(n):
  s=int(input())
  if s in d:
    if d[s]==0:
      d[s]=1
    else:
      d[s]=0
      
  if s not in d:
    d[s]=1
  
ans=0
for y in d:
  if d[y]==1:
    ans+=1
    
print(ans)

Submission status: Accepted

Solution code:
import sys
import collections
import bisect


def main():
    n = int(input())
    A = [int(input()) for _ in range(n)]
    c = collections.Counter(A)
    sumA = 0
    cKeys = c.keys()
    for cKey in cKeys:
        sumA += c[cKey] % 2
    print(sumA)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from itertools import groupby

N=int(input())
A=[int(input()) for i in range(N)]

A=sorted(A)

ans=0
for i,k in groupby(A):
    if (len(list(k)))%2==1:
        ans+=1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
l = set()
for i in range(n):
    a = int(input())
    if a in l:
        l.remove(a)
    else:
        l.add(a)
print(len(l))

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()


def main():
    N = int(input())
    d = set()
    for _ in range(N):
        a = int(input())
        if a in d:
            d.remove(a)
        else:
            d.add(a)
    print(len(d))



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n=int(input())
a=[int(input()) for i in range(n)]
num={}
counter=0
for i in range(n):
    num.setdefault(a[i],0)
    num[a[i]]+=1

for i in num:
    if num[i]%2!=0:
        counter+=1

print(counter)

Submission status: Accepted

Solution code:
import sys
n=int(input())
a=list(map(int,sys.stdin.read().split()))
a.sort()

ptr,res=0,0
while ptr < n:
  cc=a[ptr]
  f=0
  while ptr < n and a[ptr]==cc:
    f+=1
    ptr+=1
  res+=f%2
print(res)

Submission status: Accepted

Solution code:
from collections import defaultdict
import sys
n=int(input())
a=list(map(int,sys.stdin.read().split()))
a.sort()
curc=0
cntc=0
ans=0
for aa in a:
  if aa == curc:
    cntc+=1
  else:
    curc=aa
    ans+=cntc%2
    cntc=1
ans+=cntc%2
print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict
import sys
n=int(input())
a=list(map(int,sys.stdin.read().split()))
dd=defaultdict(lambda: 0)
for aa in a:
  dd[aa]+=1
ans=0
for e in dd.values():
  if e%2==1:
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
import collections

N,*A = map(int, open(0).read().split())
B = collections.Counter(A)
print(len([v for k,v in B.items() if v % 2]))

Submission status: Accepted

Solution code:
import sys
from heapq import heapify, heappop
read=sys.stdin.read

n,*a=map(int,read().split())
a.append(max(a)+1)
heapify(a)
x=heappop(a)
f=1
ans=0
while a:
  y=heappop(a)
  if x==y:
    f^=1
  else:
    ans+=f
    f=1
    x=y
print(ans)

Submission status: Accepted

Solution code:
import sys
from collections import Counter
read=sys.stdin.read

n,*a=map(int,read().split())
x=Counter(a)
print(sum(list(map(lambda n:n%2, list(x.values())))))

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	C
# CreatedDate:  2020-07-29 14:54:21 +0900
# LastModified: 2020-07-29 15:02:31 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd
from collections import Counter


def main():
    n = int(input())
    a = []
    for _ in range(n):
        a.append(int(input()))
    a_cnt = Counter(a)
    keys = a_cnt.keys()
    values = a_cnt.values()
    cnt = 0
    for k, v in zip(keys, values):
        if v % 2 == 1:
            cnt += 1
    print(cnt)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import collections
N = int(input())
A = collections.Counter(int(input()) for T in range(N)).most_common()
Num = 0
for T in range(len(A)):
    if A[T][1]%2!=0:
        Num += 1
print(Num)

Submission status: Accepted

Solution code:
N = int(input())
w = set()
for _ in range(N):
    n = int(input())
    w.add(n) if not n in w else w.remove(n)
print(len(w))

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, *A = map(int, read().split())

    d = dict()
    for a in A:
        if a in d and d[a]:
            d[a] = False
        else:
            d[a] = True

    ans = sum(1 for flag in d.values() if flag)

    print(ans)
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, *A = map(int, read().split())

    d = defaultdict(bool)
    for a in A:
        if d[a]:
            d[a] = False
        else:
            d[a] = True

    ans = sum(1 for f in d.values() if f)
    
    print(ans)
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import collections

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

A = dict(collections.Counter(A))

cnt = 0
for a in A:
    if A[a] % 2 == 1:
        cnt += 1
        
print(cnt)

Submission status: Accepted

Solution code:
n=int(input())
d={}
for _ in range(n):
    a=int(input())
    if a in d:
        d[a]+=1
    else:
        d[a]=1
c=0
for a in d.values():
    if a%2==1:
        c+=1
print(c)

Submission status: Accepted

Solution code:
from collections import Counter
n=int(input())
a=[int(input()) for _ in range(n)]
a_count=Counter(a)
count=0
for i in a_count:
    if a_count[i]%2==1:
        count+=1
print(count)

Submission status: Accepted

Solution code:
n = int(input())
A = []

for i in range(n):
    a = int(input())
    A.append(a)

A.sort()

odd = 0
prev = A[0]
cnt = 1

for i in range(1,n):
    if A[i] != prev:
        if cnt % 2 == 1:
            odd += 1
        cnt = 1
        prev = A[i]
    else:
        cnt += 1

if cnt % 2 == 1:
    odd += 1

print(odd)

Submission status: Accepted

Solution code:
from collections import Counter
N=int(input())

numbers=[]

for _ in range(N):
    A=int(input())
    numbers.append(A)

answers=Counter(numbers)

answer=0
for value in answers.values():
    if value%2==1:
        answer+=1
print(answer)

Submission status: Accepted

Solution code:
import collections
N = int(input())

A = [0]*N
for i in range(N):
    A[i] = int(input())

#print(collections.Counter(A))
c = collections.Counter(A)
count = 0
for i in c:
    count+=c[i]%2
print(count)

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
c = Counter([input() for _ in range(N)])
print(sum(i%2 for i in c.values()))

Submission status: Accepted

Solution code:
n = int(input())
d = {}
for _ in range(n):
    a = int(input())
    if a in d:
        del d[a]
    else:
        d[a] = 1
print (len(d))

Submission status: Accepted

Solution code:
import collections
n = int(input())
l = list(input() for i in range(n))
a = collections.Counter(l)
a = list(a.values())
p = 0
for i in range(len(a)):
    if a[i] % 2 != 0:
        p += 1
print(p)

Submission status: Accepted

Solution code:
n = int(input())
a = [0]*n

for i in range(n):
  a[i] = int(input())
  
a.sort()
a.append(-1)
ans = []
cn = 0
c = 1
#print(a)
for i in range(n):
  if a[i] != a[i+1]:
    ans.append(c)
    c = 1
  else:
    c += 1
#print(ans)

for i in range(len(ans)):
  if ans[i]%2 == 1:
    cn += 1
    
print(cn)

Submission status: Accepted

Solution code:
import collections
n = int(input())
a = [int(input()) for _ in range(n)]
b = collections.Counter(a)
ans = 0
for i in b.values():
    if (i%2==1):
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
lst = []
for _ in range(n):
    lst.append(int(input()))

C_lst = Counter(lst)

cnt = 0
for i in C_lst.values():
    if i % 2 != 0:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
from collections import Counter

n = int(input())
A = [0]*n
for i in range(n):
    A[i] = int(input())
#print(A)
C = Counter(A)
values, counts = zip(*C.most_common())
print(len([i for i in counts if i % 2 == 1]))

Submission status: Accepted

Solution code:
n=int(input())
d=set()
for itr in range(n):
    a=int(input())
    if a in d: d.remove(a)
    else: d.add(a)
print(len(d))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict
n, *a = map(int, open(0).read().split())
b = defaultdict(int)
for i in a:
    b[i] += 1
print(sum(i % 2 > 0 for i in b.values()))

Submission status: Accepted

Solution code:
n=int(input())
dic={}
for i in range(n):
    a=int(input())
    if a not in dic:
        dic[a]=1
    else:
        dic[a]+=1

ans=0
for i in dic:
    if dic[i]%2==1:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
import collections
n=int(input())
lst=[int(input()) for i in range(n)]
xs=list(set(lst))
ans=0
lst=collections.Counter(lst)
for i in xs:
  if lst[i]%2==1:
    ans+=1

print(ans)

Submission status: Accepted

Solution code:
import collections
N = int(input())
A = [input() for _ in range(N)]
c = collections.Counter(A)
cnt = 0
for i in set(A):
    if c[i]%2 == 1:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import Counter

def isOdd(x):
  return x % 2

def solve(n,a):
  d = Counter(a)
  return sum(map(isOdd,d.values()))


def main():
  N = int(input())
  a = [int(input()) for _ in range(N)]
  print(solve(N,a))
  return

if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import Counter

def isOdd(x):
  return x % 2

def solve(n,a):
  d = Counter(a)
  return sum(1 for x in d.values() if isOdd(x))


def main():
  N = int(input())
  a = [int(input()) for _ in range(N)]
  print(solve(N,a))
  return

if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
l = []
for i in range(n):
   l.append(int(input()))
lcnt = Counter(l)
l_value = list(lcnt.values())
for i in range(len(l_value)):
  if l_value[i]%2 == 0:
    l_value[i] = 0
  else:
    l_value[i] = 1    
print(sum(l_value))

Submission status: Accepted

Solution code:
n = int(input())

ad = dict()
for _ in range(n):
    a = int(input())
    ad.setdefault(a, -1)
    ad[a] *= -1

ans = 0
for c in ad.values():
    if c > 0:
        ans += c
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for i in range(n)]

l = sorted(a)
same = 1
count = 0
for i in range(1, n):
    if l[i] == l[i - 1]:
        same += 1
        continue
    if same % 2 == 1:
        count += 1
    same = 1
if same % 2 == 1:
    count += 1
print(count)

Submission status: Accepted

Solution code:
import collections

n = int(input())
A = list(int(input()) for i in range(n))

c = collections.Counter(A)

ans = 0

for x in c.values():
    if x % 2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
from collections import *
N = int(input())
C = Counter([int(input()) for n in range(N)])
print(sum(v%2==1 for v in C.values()))

Submission status: Accepted

Solution code:
from collections import *
N = int(input())
C = Counter([int(input()) for n in range(N)])
ans = 0

for v in C.values():
  if v%2==1:
    ans+=1

print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
n=int(input())
a=[]
for _ in range(n):
    a.append(input())
c=Counter(a)
tmp=[]
for k,v in c.items():
    if v%2!=0: 
        tmp.append(k)
print(len(tmp))

Submission status: Accepted

Solution code:
import collections
n=int(input())
a=[]
for _ in range(n):
    a.append(input())
c=collections.Counter(a)
tmp=[]
for k,v in c.items():
    if v%2!=0: 
        tmp.append(k)
print(len(tmp))

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from collections import Counter
def main():
    n = input()
    a = tuple(map(int, readlines()))
    ac = Counter(a)
    ac2 = [c % 2 for c in ac.values()]
    r = sum(ac2)
    print(r)
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
d=dict()
for _ in range(n):
    a=int(input())
    if a not in d:
        d[a]=0
    else:
        del d[a]
print(len(list(d)))

Submission status: Accepted

Solution code:
import collections
N = int(input())
A = [int(input()) for i in range(N)]
ans = 0
dict = collections.Counter(A)

for a, b in dict.items():
    if b % 2 != 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
#連想配列（Ｄｉｃｔを使った配列操作）
N = int(input())
li = []
dict1 = {}
for _ in range(N):
  li.append(int(input()))



for i in range(N):
  if str(li[i]) in dict1:
    #print("delete",li[i])
    del dict1[str(li[i])]
  else:
    #print("add",li[i])
    dict1[str(li[i])] = '0'

print(len(dict1))

Submission status: Accepted

Solution code:
n = int(input())
a_dic = {}
for i in range(n):
    a = int(input())
    if a in a_dic:
        a_dic.pop(a)
    else:
        a_dic[a] = 1
        

print(len(a_dic))

Submission status: Accepted

Solution code:
from collections import Counter as C

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

print(sum(map(lambda v:v % 2, a.values())))

Submission status: Accepted

Solution code:
from collections import Counter as C

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

print(sum([v % 2 for v in a.values()]))

Submission status: Accepted

Solution code:
from collections import Counter as C

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

print(sum([1 for v in a.values() if v % 2]))

Submission status: Accepted

Solution code:
import collections

n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
c = collections.Counter(a)
ans = 0
for k,v in c.items():
    if v % 2 == 0:
        continue
    else:
        ans +=1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = set()
for _ in range(N):
  t = input()
  if t in S:
    S.discard(t)
  else:
    S.add(t)
print(len(S))

Submission status: Accepted

Solution code:
N=int(input())

D={}
for _ in range(N):
    a=int(input())
    try:
        D[a]+=1
    except KeyError:
        D[a]=1

S=0
for b in D:
    S+=D[b]%2
print(S)

Submission status: Accepted

Solution code:
import sys
import collections

read=sys.stdin.buffer.read
readline=sys.stdin.buffer.readline
readlines=sys.stdin.buffer.readlines

N=int(readline())
A=collections.Counter(read().splitlines())

print(len([v for k,v in A.items() if v%2==1]))

Submission status: Accepted

Solution code:
N = int(input())
A = [int(input()) for _ in range(N)]
dic = {}
for i in range(N):
    data = A[i]
    if data in dic:  dic[data] += 1
    else:  dic[data] = 1
ans = 0
for i in dic:
    if dic[i] % 2:  ans += 1
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
C = Counter([int(input()) for _ in range(N)])
print(len(list(filter(lambda x: x % 2 == 1, list(C.values())))))

Submission status: Accepted

Solution code:
n = int(input())
d = {}
for i in range(n):
  a = int(input())
  d[a] = d.get(a, 0) + 1

c = 0
for e in d.values():
  if e % 2 == 1:
    c += 1
print(c)

Submission status: Accepted

Solution code:
N = int(input())
lis = list()
for i in range(N):
    lis.append(int(input()))

import collections

c = collections.Counter(lis)

ans = 0
for i in c.most_common():
    if i[1] % 2 != 0:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
a = Counter([int(input()) for i in range(n)])
ans = 0
for num, c in a.items():
    if c%2==1:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter

def main():
    a = Counter(int(input()) for _ in range(int(input())))
    ans=0
    for i,v in a.items():
        if v % 2 != 0:
            ans+=1
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from collections import deque
n = int(input())
a = [int(input()) for _ in range(n)]
da = deque(sorted(a))
dans = deque()
dans.append(da.popleft())
for _ in range(1,n):
  if len(dans) == 0:
    dans.append(da.popleft())
  else:
    dlast = dans.pop()
    daleft = da.popleft()
    if dlast != daleft:
      dans.append(dlast)
      dans.append(daleft)
print(len(dans))

Submission status: Accepted

Solution code:
from collections import Counter 
n=int(input())
a=Counter([int(input()) for _ in range(n)])
ans=0
for i in a.values():
  ans+=i%2
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline().strip() # warning bytes
# def input(): return sys.stdin.buffer.readline().decode('utf-8')


def solve():
    n = int(input())
    s = set()
    for _ in range(n):
        a = int(input())
        if a not in s:
            s.add(a)
        else:
            s.remove(a)
    print(len(s))

    

t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()


"""

1 + k



"""

Submission status: Accepted

Solution code:
s = set()
for _ in range(int(input())):
    i = (int(input()))
    if i not in s:
        s.add(i)
    else:
        s.remove(i)
print(len(s))

Submission status: Accepted

Solution code:
n = int(input())
A = []

for i in range(n):
    a = int(input())
    A.append(a)
A.sort()
i = 0
ans = 0
while True:
    cnt = 0
    while A[i + cnt] == A[i]:
        cnt += 1
        if i + cnt == n:
            break
    if cnt%2 == 1:
        ans += 1
    i += cnt
    if i == n:
        break
print(ans)

Submission status: Accepted

Solution code:
N =int(input())
set_ = set()
for _ in range(N):
    val = input()
    if val in set_:
        set_.remove(val)
    else:
        set_.add(val)
print(len(set_))

Submission status: Accepted

Solution code:
from collections import defaultdict
N = int(input())
c = defaultdict(int)
for i in range(N):
    a = int(input())
    c[a] ^= 1
print(list(c.values()).count(1))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())
a = [int(input()) for i in range(n)]
d = {}

for i in a:
    if i in d:
        del d[i]
    else:
        d[i] = i

print(len(d))

Submission status: Accepted

Solution code:
n = int(input())

d = dict()
for _ in range(n):
    a = int(input())
    if a not in d:
        d[a] = 1
    else:
        d[a] += 1

res = 0
for v in d.values():
    if v % 2 == 1:
        res += 1

print(res)

Submission status: Accepted

Solution code:
from collections import Counter


def main():
    n = int(input())
    As = list(int(input()) for _ in range(n))
    As_count = Counter(As)
    ans = 0
    for _, count in As_count.items():
        if (count % 2) == 0:
            continue
        ans += 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
A = []
for i in range(N):
  A.append(int(input()))
  
c = Counter(A)
ans = 0
for i in c.items():
  if i[1] % 2 == 1:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
A = [int(input()) for _ in range(N)]
C = Counter(A)
c = 0
for k, v in C.items():
    if v % 2 == 1:
        c += 1
print(c)

Submission status: Accepted

Solution code:
n = int(input())
C = {}
for _ in range(n):
    a = input()
    if a not in C:
        C[a] = 0
    C[a] += 1
for i in C.keys():
    C[i] %= 2
print(sum(C.values()))

Submission status: Accepted

Solution code:
from collections import defaultdict
n = int(input())
d = defaultdict(int)
for _ in range(n):
    a = input()
    d[a] += 1
ans = sum([v % 2 for v in d.values()])
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
d = {}
for _ in range(n):
  a = int(input())
  if a in d: d[a] += 1
  else: d[a] = 1

ans = 0
for i in d.values():
  if i%2 != 0: ans += 1
print(ans)

Submission status: Accepted

Solution code:
import collections
N = int(input())
ans = [0] * N

for i in range(N):
  ans[i] = int(input())
  
C = collections.Counter(ans)
count = 0
for i in C.values():
  if i % 2 == 1:
    count += 1
  
print(count)

Submission status: Accepted

Solution code:
import collections

n = int(input())
lis = []
for _ in range(n):
    lis.append(int(input()))
    
a = collections.Counter(lis)

ans = 0
for i, j in a.items():
    if j % 2 == 0:
        continue
    else:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict
N = int(input())

c = defaultdict(int)

for _ in range(N):
    c[int(input())] ^= 1

res = 0
for v in c.values():
    if v:
        res += 1

print(res)

Submission status: Accepted

Solution code:
N = int(input())

s = set()
for _ in range(N):
    A = int(input())
    if A in s:
        s.remove(A)
    else:
        s.add(A)

print(len(s))

Submission status: Accepted

Solution code:
N = int(input())
a = [input() for _ in range(N)]
a = sorted(a)
#print(a)
c = 0
ans = 0
for i in range(N):
    c += 1
    if i == N-1:
        if c % 2 == 1:
            ans += 1
    elif a[i] != a[i+1]:
        #print(a[i])
        if c % 2 == 1:
            ans += 1
        c = 0

print(ans)

Submission status: Accepted

Solution code:
import math
import collections
import fractions
import itertools
import functools
import  operator

def solve():
    n = int(input())
    a = [int(input()) for _ in range(n)]
    c = collections.Counter(a)
    cnt = 0
    for i in c:
        if c[i] % 2 == 1:
            cnt += 1
    print(cnt)
    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
import collections

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

c = list(collections.Counter(an).values())
Ans = 0
for i in range(len(c)):
    if int(c[i]) % 2 == 1:
        Ans = Ans + 1

print(Ans)

Submission status: Accepted

Solution code:
n = int(input())
d = set([])
for i in range(n):
    a = int(input())
    if a in d:
        d.remove(a)
    else:
        d.add(a)
print(len(d))

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for _ in range(n)]

a_set = set()
for a_i in a:
    a_set ^= {a_i}

print(len(a_set))

Submission status: Accepted

Solution code:
# from pprint import pprint
# import math
# import collections

n = int(input())
# n, k = map(int, input().split(' '))
# a = list(map(int, input().split(' ')))
a = []
for i in range(n):
    a.append(int(input()))

l = {}
for _a in a:
    if _a in l:
        l.pop(_a)
    else:
        l.update(
            {_a: True}
        )

print(len(l))

Submission status: Accepted

Solution code:
n=int(input())
lst=[int(input()) for i in range(n)]

from collections import Counter
c=Counter(lst)
c=c.most_common()
ans=0
for i in c:
    if i[-1]%2==1:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter

n=int(input())
a = [input() for _ in range(n)]
c = Counter(a)
count = 0
for i in c.keys():
  count += c[i]%2
print(count)

Submission status: Accepted

Solution code:
n=int(input())
a = [input() for _ in range(n)]
a.sort()
dict = {}
count = 0
for i in range(n):
  k = a[i]
  if (k in dict):
    count-=dict[k]
    dict[k]=1-dict[k]
    count+=dict[k]
  else:
    dict[k]=1
    count+=1
print(count)

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
A = [int(input()) for _ in range(N)]
C = Counter(A)
ans = sum(C[key] % 2 for key in C)
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
l = []
for i in range(n):
    l.append(int(input()))

c = Counter(l)
cnt = len(c)
l = list(c.most_common(len(c)))
for t in l:
    i = t[1]
    if i % 2 == 0:
        cnt -= 1
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for _ in range(n)]

a = sorted(a)
tmp = 0
ans = 0
for i in a:
    if i == tmp:
        ans -= 1
        tmp = 0
    else:
        ans += 1
        tmp = i

print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(500000)

def input():
    return sys.stdin.readline()[:-1]

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

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]


def main():
    N = ii()
    A = [ii() for _ in range(N)]
    dic = {}
    for a in A:
        if (not a in dic) or (dic[a] == 0):
            dic[a] = 1
        else:
            dic[a] = 0
    print(sum(dic.values()))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy,deepcopy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(map(int,input().split()))
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

N = i()
A = [i() for _ in range(N)]
C = Counter(A)
ans = 0
for c in C.values():
    if c%2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n=int(input())

d={}

for _ in range(n):
    a=int(input())
    if a not in d:
        d[a]=1
    else:
        if d[a]==1:
            d[a]=0
        else:
            d[a]=1

ans=0
for _,v in d.items():
    if v==1:
        ans+=1

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
num=[]
def ap(num1):
    num.append(num1)
for i in range(n):
    a=int(input())
    ap(a)
num.sort()
num1=num[0]
num2=1
ans=0
for i in range(n-1):
    if num[i+1]==num1:
        num2+=1
    else:
        num1=num[i+1]
        if num2%2==1:
            ans+=1
        num2=1
if num2%2==1:
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
import sys
from collections import Counter
input = sys.stdin.readline
N = int(input())
A = [int(input()) for _ in range(N)]
c = Counter(A)
print(sum(map(lambda x: x % 2, c.values())))

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
A = [int(input()) for _ in range(N)]
c = Counter(A)
print(sum(tuple(map(lambda x: x % 2, c.values()))))

Submission status: Accepted

Solution code:
n = int(input())
st = set()
for i in range(n):
  a = input()
  if a in st:
    st.discard(a)
  else:
    st.add(a)
print(len(st))

Submission status: Accepted

Solution code:
n = int(input())
d = {}
for _ in range(n):
  a = int(input())
  if a not in d: d[a] = 1
  else: d[a] += 1

ans = 0
for i in d.values():
  if i%2 != 0: ans += 1
print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict
N = int(input())
d = defaultdict(int)
for _ in range(N):
    a = int(input())
    d[a] = (d[a]+1)%2
print(sum(d.values()))

Submission status: Accepted

Solution code:
from collections import Counter
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


n = I()
a = IR(n)
counter = Counter(a)
ans = 0
for _, cnt in counter.items():
    if cnt % 2 != 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
S=set()
for i in range(N):
    S^={input()}
print(len(S))

Submission status: Accepted

Solution code:
from collections import defaultdict
n = int(input())
dd = defaultdict(int)

for i in range(n):
    dd[int(input())] += 1

ans = 0
for k, v in dd.items():
    if v % 2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
A = [input() for _ in range(n)]
AS = set()
for i in A:
    if i not in AS:
        AS.add(i)
    else:
        AS.remove(i)
print(len(AS))

Submission status: Accepted

Solution code:
import bisect
n=int(input())
a=[]
lis=[]
for i in range(n):
  inp=int(input())
  a.insert(bisect.bisect_left(a,inp),inp)
ans=0
bef=a[0]
co=0
for i in a[1:]:
  if i!=bef:
    ans+=(co+1)%2
    co=0
    bef=i
  else:
    co+=1
ans+=(co+1)%2
print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict
n=int(input())
d=defaultdict(int)
for i in range(n):
    a=int(input())
    d[a]+=1

sm=0
for i,j in d.items():
    sm+=j%2

print(sm)

Submission status: Accepted

Solution code:
n = int(input())
a_list = [int(input()) for _ in range(n)]

my_set = set()
for i in a_list:
  if i in my_set:
    my_set.remove(i)
  else:
    my_set.add(i)
print(len(my_set))

Submission status: Accepted

Solution code:
import collections
N= int(input())
A = sorted(list(int(input()) for i in range(N)))
c = collections.Counter(A)
count = 0

for v in c.values():
    if v%2 !=0:
        count +=1 

print(count)

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc073/tasks/abc073_c
# 偶数個を抜くだけ
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def exit(*argv, **kwarg):
    print(*argv, **kwarg)
    sys.exit()


def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))
# 受け渡されたすべての要素からsubだけ引く.リストを*をつけて展開しておくこと


def a_int(): return int(read())


def read_col(H):
    '''H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


from collections import Counter
N = a_int()
A, = read_col(N)
ans = 0
for v in Counter(A).values():
    ans += v & 1
print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict
N=int(input())
D=defaultdict(int)
for i in range(N):
    a=int(input())
    D[a]+=1

ans=0
for v in D.values():
    if v%2==1:
        ans+=1

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
A=[int(input()) for _ in range(N)]
A.sort()
A.append(0)
ans=0
i=0
j=0
while i<N:
  b=A[i]
  c=0
  while b==A[i] and i<N:
    c+=1
    i+=1
  ans+=(c%2)
print(ans)