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:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]

def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def main():
    N = int(input())
    m = defaultdict(int)
    for _ in range(N):
        A = int(input())
        m[A] += 1

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(sum([1 for i in d.values() if i % 2 == 1]))

Submission status: Accepted

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

Submission status: Accepted

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

num = {}
for i in range(n):
    if not a[i] in num.keys():
        num[a[i]] = 1
    elif num[a[i]] == 1:
        num[a[i]] = 0
    else:
        num[a[i]] = 1
        
ans = 0
for k in num.keys():
    if num[k] > 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

paper = set()
for i in range(N):
  x = int(input())
  if x in paper:
    paper.remove(x)
  else:
    paper.add(x)
    
print(len(paper))

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for i in range(n)]
writed = {}
for v in a:
    if v in writed:
        del writed[v]
    else:
        writed[v] = True
print(len(writed))

Submission status: Accepted

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


a_set = set()
for ai in a:
    if ai in a_set:
        a_set.remove(ai)
    else:
        a_set.add(ai)
        
print(len(a_set))

Submission status: Accepted

Solution code:
import collections
n = int(input())
a = [input() for i in range(n)]
c = collections.Counter(a)

cnt = 0

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


print(cnt)

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)
result = 0
for i in c:
     if c[i] % 2 == 1:
         result += 1
print(result)

Submission status: Accepted

Solution code:
N = int(input())

dic = {}
for i in range(N):
    a = int(input())
    if a in dic:
        dic.pop(a)
    else:
        dic[a] = 1
ans = len(dic)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
n = [0] * N
for i in range(N):
  n[i] = int(input())
n.sort()
i=0
cnt = 1
while(i<N-1):
  if n[i] == n[i+1]:
    cnt += 1

  else:
    if cnt % 2 == 1:
      ans += 1
    cnt = 1

  i += 1

if cnt % 2 == 1:
  ans += 1
 
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
n = []
for i in range(N):
  n.append(int(input()))
n.sort()
i=0
cnt = 1
while(i<N-1):
  if n[i] == n[i+1]:
    cnt+=1
  else:
    if cnt%2==1:
      ans+=1
    cnt = 1
    
  i+=1
if cnt%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)
ans = 0
for k, v in c.items():
    ans += v % 2
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter
from functools import reduce

N = int(input())
c = Counter(input() for _ in range(N))
print(reduce(lambda a, x: a + (x & 1), c.values(), 0))

Submission status: Accepted

Solution code:
N, = map(int, raw_input().split())
d = {}
for i in range(N):
  a, = map(int, raw_input().split())
  d[a] = d.get(a, 0)+1
r = 0
for k in d.keys():
  r += 0 if d[k]%2==0 else 1
print r

Submission status: Accepted

Solution code:
from collections import defaultdict
N = int(input())
A = defaultdict(int)
cnt = 0
for i in range(N):
  a = int(input())
  A[a - 1] += 1
for v in A.values():
  cnt += v % 2
print(cnt)

Submission status: Accepted

Solution code:
from itertools import groupby
n = int(input())
a = [int(input()) for _ in range(n)]
a = sorted(a)
g = groupby(a)
res = 0
for k,v in g:
    res += len(list(v))%2
print(res)

Submission status: Accepted

Solution code:
from collections import defaultdict

N = int(input())
a = [ int(input()) for i in range(N) ]
d = defaultdict(int)

cnt = 0
for i in a:
    if d[i] == 1:
        d[i] = 0
        cnt -= 1
    else:
        d[i] = 1
        cnt += 1


print(cnt)

Submission status: Accepted

Solution code:
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
AtoZ = [chr(i) for i in range(65,65+26)]
atoz = [chr(i) for i in range(97,97+26)]

def inpl(): return list(map(int, input().split()))
def inpl_s(): return list(input().split())

N = int(input())
dd = defaultdict(int)
ans = 0
for i in range(N):
	a = int(input())
	if dd[a] == 0:
		dd[a] = 1
		ans += 1
	else:
		dd[a] = 0
		ans -= 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(raw_input())
s = set()
for i in range(n):
    t = int(raw_input())
    if t in s:
        s.remove(t)
    else:
        s.add(t)
print len(s)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 10 05:13:17 2018

@author: Yuki
"""

import collections

N = int(input())

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

A_dict = collections.Counter(A)

cnt = 0
for val in A_dict.values():
    if val%2==1:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
dict = {}
for i in range(0, n):
    ai = int(input())
    if not ai in dict.keys():
        dict[ai] = 1
    else:
        dict.pop(ai)

print(len(dict))

Submission status: Accepted

Solution code:
N = int(input())

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

A.sort()


tmpcount = 1
count = 0
A.append(-1)

for i in range(1,N+1):
    if A[i] == A[i-1]:
        tmpcount += 1
    else:
        if tmpcount % 2 == 1:
            count += 1
        tmpcount = 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

count_dct = {}
for input_num in a_list:
    if input_num in count_dct.keys():
        count_dct[input_num] += 1
    else:
        count_dct[input_num] = 1
        
counter = 0
for i, j in count_dct.items():
    if j%2 == 1:
        counter +=1
    else:
        pass
    
print(counter)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

n = int(input())
# a = map(int, sys.stdin.read().split("\n"))
a = map(int, [int(input()) for i in range(n)])

d = dict()
for a_i in a:
	if a_i not in d:
		d[a_i] = 0
	d[a_i] = (d[a_i]+1) % 2

print(sum(d.values()))

Submission status: Accepted

Solution code:
import sys

n = int(input())
# a = map(int, sys.stdin.read().split("\n"))
a = [int(input()) for i in range(n)]

d = dict()
for a_i in a:
	if a_i not in d:
		d[a_i] = 0
	d[a_i] = (d[a_i]+1) % 2

print(sum(d.values()))

Submission status: Accepted

Solution code:
import sys

n = int(input())
# a = map(int, sys.stdin.read().split("\n"))
a = map(int, [input() for i in range(n)])

d = dict()
for a_i in a:
	if a_i not in d:
		d[a_i] = 0
	d[a_i] = (d[a_i]+1) % 2

print(sum(d.values()))

Submission status: Accepted

Solution code:
#-*-coding:utf-8-*-
from collections import Counter

def main():
    n = int(input())
    a_list = []
    for _ in range(n):
        a_list.append(int(input()))
    
    ans = 0
    cnt = Counter(a_list)
    for i in set(a_list):
        if cnt[i] % 2 != 0:
            ans += 1
    print(ans)



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
A = []
for i in range(N):
    A.append(int(input()))
A = sorted(A)
ans = 0
K = A[0]
cnt = 0
for i in range(N):
    if A[i] == K:
        cnt = (cnt + 1)%2
    else:
        K = A[i]
        ans += cnt
        cnt = 1
if A[N-1] == K:
    ans += cnt
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(int(input()) for _ in range(n))
d = {}
for i in range(n):
    d[a[i]] = d.get(a[i], 0) + 1
ans = 0
for v in d.values():
    if v % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
d = {}

for i in range(N) :
    n = int(input())
    
    if n in d.keys() :
        d[n] += 1
    else : d[n] = 1

cnt = 0
for k in d.keys() :
    if d[k] % 2 != 0 :
        cnt += 1
        
print(cnt)

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
A = [int(input()) for i in range(N)]
counter = Counter(A)
b =[]

for k,v in counter.items():
    if v % 2 !=0:
        b.append(k)
print(len(b))

Submission status: Accepted

Solution code:
from collections import Counter

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

cntr = Counter(A)

ans = 0
for v in cntr.values():
    ans += v%2

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = set()
for i 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_list = []
for i in range(N):
    A_list.append(int(input()))
    
A_list.sort()

res = 0
cnt = 0
ans = 0
for a in A_list:
    if res == a:
        cnt += 1
    else:
        ans += cnt%2
        res = a
        cnt = 1
        
ans += cnt%2

print(ans)

Submission status: Accepted

Solution code:

from bisect import bisect_left,bisect_right

N = int(input())
A_list = []
for i in range(N):
    A_list.append(int(input()))

A_unique = list(set(A_list))


A_list.sort()

ans = 0
for a in A_unique:
    if (bisect_right(A_list,a)-bisect_left(A_list,a))%2 == 1:
        ans += 1
        
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

from collections import Counter 

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

# 各数値ごとに数を集計
AN_dict = Counter(AN)

cnt = 0
for key, value in AN_dict.items():
    if value % 2 != 0:
        cnt += 1
print(cnt)

Submission status: Accepted

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

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:
x=int(input())
a=[]
B={-1}
for i in range(x):
  Y=int(input())
  if Y not in B:
    B.add(Y)
  else:
    B.discard(Y)
print(len(B)-1)

Submission status: Accepted

Solution code:
N=int(input())
a={}
for i in range(N):
    x = input()
    if x in a:
        a[x] = 1^a[x]
    else:
        a[x] = 1
print(sum(a.values()))

Submission status: Accepted

Solution code:
n=int(input())
count=0
li=[0 for i in range(n)]
for i in range(n):
    a=int(input())
    li[i]=a
li.sort()
i=0
x=1
while i<n-1:
    if li[i]==li[i+1]:
        x+=1
        if i+2==n-1:
            count+=1
    else:
        x=1
        if i+1==n-1:
            count+=1
    if x%2==1:
        count+=1
    i+=x
    x=1
print(count)

Submission status: Accepted

Solution code:
N=int(input())

a=[0]*N

for i in range(N):
  a[i]=int(input())
  
a.sort()
count=1
ans=[]

for i in range(N-1):
  if a[i]==a[i+1]:
    count+=1
  else:
    if count%2==1:
      ans.append(a[i])
    count=1
    
if count%2==1:
  ans.append(a[i])

print(len(ans))

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
src = [int(input()) for i in range(N)]
ctr = Counter(src)
print(len([1 for v in ctr.values() if v%2]))

Submission status: Accepted

Solution code:
n=int(input())
d={}
for _ in [0]*n:
    v=int(input())
    d[v]=(d.get(v,0)+1)%2
    
print(sum(d.values()))

Submission status: Accepted

Solution code:
N=int(input())
A=[]
for i in range(N):
    A.append(int(input()))
bucket={}
for number in A:
    bucket[number]=0
for number in A:
    bucket[number]+= 1
count=0
for key in bucket:
    if bucket[key]%2==1:
        count+=1
    else:
        pass
print(count)

Submission status: Accepted

Solution code:
N = int(input())
a = list()
ans = 0
ptr = 0

for i in range(N):
    a.append(int(input()))

A = sorted(a)

while(ptr < N):
    cc = A[ptr]
    f = 0
    
    while(ptr < N and A[ptr] == cc):
        f += 1
        ptr += 1
        
    ans += f % 2

print(ans)

Submission status: Accepted

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

print(len(a))

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:
from collections import defaultdict

dict=defaultdict(int)
N=int(input())
for i in range(N):
  a=int(input())
  dict[a]^=1
  
ans=0
for k,v in dict.items():
  if v==1:
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
# input
N = int(input())
A = [int(input()) for _ in range(N)]

A = sorted(A)
i = 0
ans = 0

while i < N:
    k = 1
    while (i + k) < N and A[i] == A[i + k]:
        k += 1
    if (k - 1) % 2 == 0:
        ans += 1
    i = i + k

print(ans)

Submission status: Accepted

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

from collections import Counter

print(sum(c % 2 for x, c in Counter(A).items()))

Submission status: Accepted

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

xs = {}
r = 0

for a in A:
    if a in xs and xs[a] == 1:
        xs[a] = 0
        r -= 1
    else:
        xs[a] = 1
        r += 1

print(r)

Submission status: Accepted

Solution code:
N = int(input())
a = []
for i in range(N):
    a.append(input())
a.sort()
b = []
b.append(1)
j =1
k = 0
while j < N:
  if j == N:
    break
  elif a[j-1] == a[j]:
    b[k] += 1
    j += 1
  elif a[j-1] != a[j]:
    b.append(1)
    k += 1
    j += 1
ans = 0
for c in b:
  if c %2==1:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

B = {}
for a in A:
    if a not in B:
        B[a] = 1
    else:
        B[a] += 1

ans = 0
for b in B.keys():
    if B[b] % 2:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

dic = {}
for i in range(n):
	tmp = int(input())
	if dic.has_key(tmp):
		dic[tmp] += 1
	else :
		dic[tmp] = 1

count = 0 
for i in dic.values():
	count += i%2

print count

Submission status: Accepted

Solution code:
from collections import Counter
c = Counter()
N = int(input())
for _ in range(N):
    a = int(input())
    c[a] += 1
count = 0
for key, value in c.items():
    if value % 2 != 0:
        count += 1
print(count)

Submission status: Accepted

Solution code:
nums = set()
for _ in [0] * int(input()):
    A = int(input())
    if A in nums:
        nums.remove(A)
    else:
        nums.add(A)
print(len(nums))

Submission status: Accepted

Solution code:
numbers = {}
for _ in [0] * int(input()):
    A = int(input())
    numbers[A] = numbers.get(A, 0) ^ 1
print(sum(numbers.values()))

Submission status: Accepted

Solution code:
from collections import Counter

N = int(input())
inupt_dict = Counter(int(input()) for i in range(N))
count = 0

for value in inupt_dict.values():
    count += (value%2)

print(count)

Submission status: Accepted

Solution code:
N=int(input())
A=[None]*N

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

Ans=0
A.sort()
A+=[-1]
j=1
for i in range(1,N+1):
    if A[i]==A[i-1]:
        j+=1
    else:
        if j%2==1:
            Ans+=1
        j=1

print(Ans)

Submission status: Accepted

Solution code:
N = int(input())

paper = {}
for i in range(N):
    t = int(input())
#    print(t)
 #   print(paper)
    if t in paper:
        paper[t] = not(paper[t])
    else:
        paper[t] = True

ans = 0
for b in paper.values():
    if b:
        ans +=1

print(ans)
#print(paper)

Submission status: Accepted

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

c = Counter(a)
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
hairetsu={}
x=0
for i in range(N):
    x=int(input())
    if x in hairetsu.keys():
        del hairetsu[x]
    else:
        hairetsu[x]=x
print(len(hairetsu))

Submission status: Accepted

Solution code:
N=int(input())
sister=[]
for i in range (N):
    A=int(input())
    sister.append(A)
sister
import collections
c=collections.Counter(sister)
sister_unique=list(set(sister))
count=0
for j in range (len(sister_unique)):
    if c[sister_unique[j]]%2!=0:
        count+=1
print (count)

Submission status: Accepted

Solution code:
n = int(input())
dict = {}
ans = 0
for i in range(n):
    c = input()
    if(c in dict):
        dict[c] += 1
    else:
        dict[c] = 1
for i in dict:
    ans += dict[i] % 2
print(ans)

Submission status: Accepted

Solution code:
import collections

n = int(input())

array = [int(input()) for x in range(n)]
dict_array = collections.Counter(array)
res = 0
for i, j in dict_array.items():
    if j % 2 != 0:
        res += 1
print(res)

Submission status: Accepted

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

ans = 0
for i in b:
    if b[i]%2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
def m():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    A.sort()
    tmp = -1
    cnt = 0
    ans = 0
    for i in range(N):
        if tmp == A[i]:
            cnt +=1
        else:
            if cnt % 2 == 0: pass
            else: ans +=1
            tmp = A[i]
            cnt = 1

    if cnt % 2 == 0: pass
    else: ans += 1
    return ans

print(m())

Submission status: Accepted

Solution code:
N = int(raw_input())
A = []
for i in range(0, N):
	A.append(int(raw_input()))
A.sort()
i = 0
while i < len(A)-1:
	if A[i] == A[i+1]:
		A.pop(i)
		A.pop(i)
	else:
		i = i + 1

print len(A)

Submission status: Accepted

Solution code:
from collections import Counter

n = int(input())
a = []
for i in range(0,n):
    a.append(int(input()))
ac = Counter(a)

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
a = {}
for i in range(N):
    j = int(input())
    if j in a:
        a[j] += 1
    else:
        a[j] = 1
count = 0
for v in a.values():
    if v % 2 == 1:
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())

s = set([])
for _ in range(n):
    x = int(input())
    if x in s:
        s.remove(x)
    else:
        s.add(x)

print(len(s))

Submission status: Accepted

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

print(len(list(filter(lambda x: x%2==1, D.values()))))

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).most_common()
Ans = 0
for i in range(len(C)):
    x,y = C[i]
    if y%2 == 1:
        Ans += 1
print(Ans)

Submission status: Accepted

Solution code:
N = int(input())
src = [int(input()) for i in range(N)]

ss = set()
for a in src:
    if a in ss:
        ss.remove(a)
    else:
        ss.add(a)
print(len(ss))

Submission status: Accepted

Solution code:
from collections import Counter

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

A_counter = Counter(A_list)

num_odd = sum([count % 2 for count in A_counter.values()])
print(num_odd)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict

N = int(input())

A = defaultdict(int)
for i in range(N):
    A[input()] += 1
    
ans = 0

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

Submission status: Accepted

Solution code:
n = int(input())
times = {}

for i in range(n):
    a = int(input())
    times[a] = times.get(a, 0) + 1

cnt = 0

for i in times:
    if times[i]%2 == 1:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
nums = set()

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

    try:
        nums.remove(a)
    except KeyError:
        nums.add(a)

print(len(nums))

Submission status: Accepted

Solution code:
import collections as c

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

d = c.Counter()
for i in a:
    d[i] += 1

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

print (ans)

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
A = [int(input()) for k in range(N)]
C = Counter(A)

ans = 0
for e in C:
    ans += C[e]%2
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

nlll = {}
    
for i in range(n):
    aaa = int(input())
    if aaa in nlll:
        del nlll[aaa]
    else:
        nlll.update({aaa:1})

sums = 0
for i in nlll.values():
    sums = sums + i
print(sums)

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:
# -*- coding: utf-8 -*-

# AtCoder Beginner Contest
# Problem C

if __name__ == '__main__':
    from collections import Counter

    n = int(input())
    a = [0] * n
    count = 0

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

    for key, value in Counter(a).items():
        if value % 2 != 0:
            count += 1

    print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
A,Ans = [],0
for i in range(N):
    A.append(int(input()))
cA = Counter(A).most_common()
for k,v in cA:
    if v%2 != 0:
        Ans += 1
print(Ans)

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
a = [input() for _ in range(n)]
counter = Counter(a)
count = 0
for name, cnt in counter.most_common():
    if cnt%2 != 0:
        count += 1
print(count)

Submission status: Accepted

Solution code:
N=int(input())
s=[int(input()) for i in range(N)]
d,ans={},0
for j in s:
    d[j]=d.get(j,0)+1
d=list(d.values())
for k in d:
    if k%2==1:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
s=[int(input()) for i in range(N)]
d,ans={},0
for j in s:
    d[j]=d.get(j,0)+1
d=list(d.values())
for k in range(len(d)):
    if d[k]%2==1:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
import collections
N = int(input())
list_A = [0]*N
for i in range(N):
    list_A[i] = int(input())
c = collections.Counter(list_A)
c_odd_even = [i%2 for i in list(c.values())]
print(sum(c_odd_even))

Submission status: Accepted

Solution code:
from collections import defaultdict


def solve():
    N = int(input())
    d = defaultdict(int)
    for i in range(N):
        a = int(input())
        if d[a] == 0:
            d[a] = 1
        else:
            del d[a]
    print(len(d))


solve()

Submission status: Accepted

Solution code:
N = int(input())

dict = {}
for _ in range(N):
    x = int(input())
    if x in dict.keys():
        dict[x] += 1
    else:
        dict[x] = 1

print(sum(list(map(lambda x : x%2, dict.values()))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
d = {}
for _ in range(int(input())):
    x = int(input())
    d[x] = d.get(x, 0) + 1
c = 0
for v in d.values():
    if v % 2: c += 1
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
loops = int(input())
d = {}

# 10^6
for _ in range(loops):
    key = input()
    if key not in d: # ?
        d[key] = 1
    else:
        d[key] += 1

# 10^6
ans = 0
for k,v in d.items():
    if v % 2 != 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()

n = ni()
s = set()
for i in range(n):
    x = ni()
    if x in s:
        s.remove(x)
    else:
        s.add(x)
print(len(s))

Submission status: Accepted

Solution code:
import math
import sys

def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result





arr_data = getinputdata()

n = int(arr_data[0][0])

mysum=0


hash01={}
for i in range(1,1+n):

#    temp=int(arr_data[i][0])
    
    cnt=hash01.get(int(arr_data[i][0]),0)+1
    
    hash01[int(arr_data[i][0])]=cnt
    
#print(hash01)

for k in hash01:
    
    if hash01[k] % 2!=0:
        
        mysum+=1
        
print(mysum)

Submission status: Accepted

Solution code:
N = int(input())
A = set()
x = 0
for i in range(N):
    s = int(input())
    if s in A:
        A.remove(s)
    else:
        A.add(s)



print(len(A))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
paper = set()
for i in range(n):
  tmp = input().rstrip()
  if tmp not in paper:
    paper.add(tmp)
  else:
    paper.remove(tmp)
print(len(paper))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

n=int(input())
a=[]
for _ in range(n):
    a.append(input())
ac=Counter(a)
ans=0
for i  in ac.values():
    if i%2==1:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
memo = {}
for _ in range(N):
    A = int(input())
    if (A not in memo) or memo[A] == 0:
        memo[A] = 1
    else:
        memo[A] = 0
print(sum(memo.values()))

Submission status: Accepted

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

print(sum(dic.values()))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
l = [int(input()) for i in range(n)]
l.sort()

def f():
  ans = 0
  count = 1
  now = l[0]

  if n == 1:
    return 1

  for i in range(1, n):
    if l[i] == now:
      count += 1
    else:
      if not count % 2 == 0:
        ans += 1
      count = 1
      now = l[i]
    
    if i == n-1 and not count % 2 == 0:
      ans += 1
  return ans

print(f())