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())
a_d = {}
for i in range(n):
    a = int(input())
    if a in a_d:
        a_d[a] += 1
    else:
        a_d[a] = 1
 
ans = 0
for i in a_d.values():
    if i % 2:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict
def solve():
    N = int(input())
    d = defaultdict(int)
    for _ in range(N):
        A = int(input())
        d[A] += 1
    
    cnt = 0
    for key, val in d.items():
        if val % 2 != 0:
            cnt += 1
    
    print(cnt)

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
from collections import Counter
n=int(input())
l=[str(input()) for i in range(n)]
c=Counter(l)
cnt=0
for i in c:
  if c[i]%2==1:
    cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
a = []
flag = 0
d = 0
for i in range(n):
  a.append(int(input()))
a.sort()
for i in range(n - 1):
  if flag == 1:
    flag = 0
  elif a[i] == a[i + 1]:
    d = d + 2
    flag = 1
print(len(a) - d)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

N = int(input())
A = [int(input()) for _ in range(N)]
A.sort()
ans = 0
count = 0
current_num = A[0]
for i in range(N):
    if A[i] == current_num:
        count += 1
    else:
        if count % 2 == 1:
            ans += 1
        count = 1
        current_num = A[i]
if count % 2 == 1:
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

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

a = list(Counter(A).values())
ans = 0
for i in a:
    if i % 2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

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

for a in A:
    if a not in l:
        l[a] = 0
    if l[a] != 0:
        l[a] = 0
    else:
        l[a] = 1

ans = 0
for d in l.values():
    ans += d

print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
N=int(input())
A=[int(input()) for _ in range(N)]
l=[]
c=Counter(A)
values=list(c.values())
key=list(c.keys())
cnt=0
for i in range(len(key)):
    l.append([key[i],values[i]])

for i in range(len(key)):
    if l[i][1]%2==1:
        cnt=cnt+1
print(cnt)

Submission status: Accepted

Solution code:
#abc073 c
n=int(input())
a=dict()
for i in range(n):
    x=int(input())
    if x not in a:
        a[x]=1
    else:
        a[x]+=1
ans=0
for i in a.values():
    if i%2==1:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
L=[0 for _ in range(n+1)]
for i in range(n):
    L[i]=int(input())
list.sort(L, reverse=True)
ans=0
cnt=1
for i in range(n):
    if L[i]==L[i+1]:
        cnt+=1
    else:
        if cnt%2!=0:
            ans+=1
        cnt=1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

L = set([])

for i in range(n):
    tmp = int(input())
    if tmp in L:
        L.remove(tmp)
    else:
        L.add(tmp)

print(len(L))

Submission status: Accepted

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

import collections

c = collections.Counter(l)
ans = 0
for i in c.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 i in range(n):
    a=int(input())
    d[a]+=1

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

Submission status: Accepted

Solution code:
n=int(input())
SET=set()
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())
l = [int(input()) for _ in range(n)]
d = {}
for i in l:
    d[i] = d.get(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())
a=[0 for _ in range(n)]
for i in range(n):
  a[i]=int(input())
a.sort()
ans,cnt=0,0
p=-1
for x in a:
  if p==x:
    cnt+=1
  else:
    p=x
    if cnt%2==1:
      ans+=1
    cnt=1
if cnt%2==1:
  ans+=1
print(ans)

Submission status: Accepted

Solution code:
import collections
a = int(input())
b = [input() for i in range(a)]
b = list(collections.Counter(b).values())
b = [i for i in b if i%2==1]
print(len(b))

Submission status: Accepted

Solution code:
#073_C
n=int(input())
s=set()
for _ in range(n):
    s^={input()}
print(len(s))

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
a = [int(input()) for _ in range(n)]
count_a = list(Counter(a).items())
result = 0
for x, y in count_a:
    if y%2==1:
        result += 1
print(result)

Submission status: Accepted

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

from collections import Counter
c = Counter(A)
keys, values = zip(*c.most_common())

n = len(values)
ans = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

from collections import defaultdict
d = defaultdict(int)
for _ in range(n):
    d[int(input())] += 1

# 数字が奇数回現れたら残り、偶数回なら消える
ans = 0
for v in d.values():
    if v%2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env pypy3
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    from collections import defaultdict
    dd = defaultdict(int)
    
    N=I()
    for i in range(N):
        A=I()
        dd[A]+=1
    ans=0
    for k,v in dd.items():
        if v%2==1:
            ans+=1
    print(ans)

main()

Submission status: Accepted

Solution code:
N = int(input())
A = []
for _ in range(N):
    A.append(int(input()))
A = sorted(A)
cnt = 1
ans = 0

for i in range(N-1):
    if(A[i] == A[i+1]):
        cnt += 1
        continue
    ans += cnt % 2
    cnt = 1

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
n = int(input())

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

    
d = {}
for a in al:
    d.setdefault(a, 0)
    d[a] = (d[a] + 1) % 2

print(sum(d.values()))

Submission status: Accepted

Solution code:
n = int(input())

A = []

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

A = sorted(A)



s = A

A = []
t = 1
for i in range(1, len(s)):
    if s[i - 1] != s[i]:
        A.append(s[i-1])
        A.append(str(t))
        t = 1
    else:
        t += 1
    if i == len(s) - 1:
        if s[i-1] == s[i]:
            A.append(s[i-1])
            A.append(str(t))
        else:
            A.append(s[i])
            A.append("1")
# print("".join(A))
t = 0
for i in range(len(A)):
    if i % 2 == 1:
        if int(A[i]) % 2 == 1:
            t += 1
print(t)

Submission status: Accepted

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

Submission status: Accepted

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

print(len(ans))

Submission status: Accepted

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

ptr=0
res=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 Counter
n=int(input())
a=[int(input()) for i in range(n)]

c=Counter(a)
cnt=0
for v in c.values():
    if v%2==1:
        cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
L = []
ans_L = {}

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

for j in L:
    if not j in ans_L.keys():
        ans_L[j] = 0
    
    if ans_L[j]==0:
        ans_L[j] += 1
    elif ans_L[j]== 1:
        ans_L[j] -= 1

print(sum(ans_L.values()))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N=int(input())
ans=dict()
cnt=0

for _ in range(N):
    A=int(input())
    if((A in ans)==False):
        ans[A]=1
    else:
        ans[A]+=1

for value in ans.values():
    if(value%2==1):
        cnt+=1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    a_list = list([int(input()) for _ in range(N)])
    a_freq = collections.Counter(a_list)
    print(len([freq for freq in a_freq.values() if freq % 2 == 1]))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
d = {}
for i 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:
N = int(input())
list_A = [int(input()) for i in range(N)]

from collections import Counter
list_X = Counter(list_A).values()

ans = 0
for X in list_X :
    if X%2 == 1 :
        ans += 1

print(ans)

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())
p=[]
count=0
for i in range (N):
  a=int(input())
  p.append(a)
list.sort(p)
flag=1
for j in range (N-1):
  if p[j]==p[j+1]:
    flag*=-1
  else:
    if flag>0:
      count+=1
    flag=1
if flag>0:
  count+=1
print(count)

Submission status: Accepted

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

now=a[0]
odd=False
ans=0
for i in range(n):
	#前の文字と一緒の時
	if a[i]==now:
		odd=not odd
	#前の文字と違う時
	else:
		#前の文字の個数の偶奇を判定し、奇数ならansをインクリメント
		ans+=odd
		#注目する文字を今の文字にする
		now=a[i]
		odd=True
#最後の文字をきちんと処理するためにoddを加える
print(ans+odd)

Submission status: Accepted

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

now=a[0]
odd=False
ans=0
for i in range(n):
	#前の文字と一緒の時
	if a[i]==now:
		odd=not odd
	#前の文字と違う時
	else:
		#前の文字の個数の偶奇を判定し、奇数ならansをインクリメント
		ans+=odd
		#注目する文字を今の文字にする
		now=a[i]
		odd=True
#最後の文字をきちんと処理するためにoddを加える
print(ans+odd)

Submission status: Accepted

Solution code:
from collections import Counter
n=int(input())
a=[int(input()) for i in range(n)]
print(sum(map(lambda x: x%2,Counter(a).values())))

Submission status: Accepted

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

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

Submission status: Accepted

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

now=a[0]
odd=0
ans=0
for i in range(n):
	#前の文字と一緒の時
	if a[i]==now:
		odd=(odd+1)%2
	#前の文字と違う時
	else:
		#前の文字の個数の偶奇を判定し、奇数ならansをインクリメント
		ans+=odd
		#注目する文字を今の文字にする
		now=a[i]
		odd=1
#最後の文字をきちんと処理するためにoddを加える
print(ans+odd)

Submission status: Accepted

Solution code:
import collections

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

count_dict = collections.Counter(A)

# print(count_dict)

count = 0

for i in count_dict.values():
    if i % 2 == 1:
        count += 1

print(count)

Submission status: Accepted

Solution code:
n = int(input())
d = {}
for i 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:
def main():
    repeat = int(input())
    announced_num = [int(input()) for _ in range(repeat)]
    count = {}
    for number in announced_num:
        if number in count:
            if count[number] % 2:
                count[number] = 0
            else:
                count[number] = 1
        else:
            count[number] = 1
    answer = 0
    for i in count.values():
        answer += i
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


#----------
N = int(input().strip())
A_list = [int(input().strip()) for _ in range(N)]
#----------
A_dic = {}
A_set =set()

for i in A_list:
    if i not in A_set:
        A_set.add(i)
    else:
        A_set.remove(i)

print(len(A_set))

Submission status: Accepted

Solution code:
N=int(input())
d={}
for i 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:
N=int(input())
A=[]
for i in range(N):
    A.append(int(input()))
B=sorted(A)
ans=0
tmp=B[0]
cnt=1
for i in range(1,N):
    if(tmp==B[i]):
        cnt+=1
    else:
        ans+=(cnt%2)
        cnt=1
        tmp=B[i]
ans+=cnt%2
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter

n = int(input())
a = []

for _ in range(n):
    a.append(int(input()))

ctr = Counter(a)

ans = len([i[0] for i in ctr.items() if i[1] % 2 == 1])

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())
a = [int(input()) for _ in range(n)]
a.sort()
cnt = 1
ans = 0
for i in range(n-1):
    if a[i] == a[i+1]:
        cnt += 1
    else:
        if cnt %2: ans+= 1
        cnt = 1
print(ans+cnt%2)

Submission status: Accepted

Solution code:
n = int(input())
paper = set()
for _ in range(n):
  a = int(input())
  if not a in paper:
    paper.add(a)
  else:
    paper.remove(a)
    
print(len(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 == 0:
        continue
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
a=[int(input()) for _ in range(n)]
a.sort()
a.append(0)
count=1
ans=0
for i in range(n):
    if a[i]==a[i+1]:
        count+=1
    else:
        if count%2==1:
            ans+=1
        count=1
print(ans)

Submission status: Accepted

Solution code:
import collections

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

a = dict(collections.Counter(a))
ans = [i for i in a.values() if i%2 == 1]

print(len(ans))

Submission status: Accepted

Solution code:
n = int(input())

d = set()
for _ in range(n):
    d ^= {input()}
    
print(len(d))

Submission status: Accepted

Solution code:
import collections
n = int(input())
a = [int(input()) for _ in range(n)]
c = list(collections.Counter(a).values())
print(sum([c_i % 2 for c_i in c]))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def writeanderase(n , a):

    ans = {}
    count = 0

    for i in range(n):
        if a[i] in ans:
            ans[a[i]] += 1
        else:
            ans[a[i]] = 1

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

    return count

def main():
    n = int(input())
    a = [int(input()) for i in range(n)]
    print(writeanderase(n , a))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter
import itertools

N = int(input())
A = [int(input()) for _ in range(N)]
c = Counter(A)
ans = len(list(itertools.filterfalse(lambda x: x % 2 != 1, c.values())))
print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.buffer.readline

from collections import defaultdict

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

cnt = defaultdict(int)
for a in A:
    if cnt[a]:
        cnt[a] = 0
    else:
        cnt[a] = 1

print(sum(cnt.values()))

Submission status: Accepted

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

cA = Counter(A).values()
r = 0
for i in cA:
    r += i%2
print(r)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
from functools import reduce
mod = 10 ** 9 + 7
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

n=ii()
a=lin(n)

arr=Counter(a)
v=list(arr.values())
ans=0
for i in range(len(v)):
    if v[i]%2==1:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
n = int(input())
A = [int(input()) for _ in range(n)]
dic = {}
for a in A:
    if dic.get(a,0):
        dic[a] = 0
    else:
        dic[a] = 1
print(sum([v for k,v in dic.items()]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def pin(type=int):
    return map(type,input().split())
#どっかで最悪計算量の入力データを用意する関数を作ろう？
"""
バケットで管理したかったけど数字が多いのでソートして同じ数を固めることに
"""
#solution:
#潜 影 蛇 手 ! !
N=int(input())
a=[]
for i in range(N):
    a.append(int(input()))
a.sort()
bac=1
ans=0
for j in range(N-1):
    if a[j+1]!=a[j]:
        ans+=bac%2
        bac=1
    else:
        bac+=1
ans+=bac%2
print(ans)

Submission status: Accepted

Solution code:
'''
全量のリストを用いると検索対象が大きくなってしまうため、ディクショナリで都度追加/削除する
'''

N = int(input())

A = {}

for _ in range(N):
    tmp = int(input())
    if tmp in A:
        del A[tmp]
    else:
        A[tmp] = 1

print(len(A))

Submission status: Accepted

Solution code:
n = int(input())
dict = {}
for i in range(n):
  tmp = int(input())
  if tmp in dict:
    del dict[tmp]
  else:
    dict[tmp] = 1
    
print(len(dict))

Submission status: Accepted

Solution code:
N = int(input())

set_ = set()
for n 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())
l = {}
for i in range(n):
  a = int(input())
  if a in l:
    l[a] +=1
  else:
    l[a] = 1
ans = 0
for i in l.values():
    if i % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
from operator import itemgetter

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

B = Counter(A)
B = list(B.items())
B1 = sorted(B,key=itemgetter(1),reverse = True) 

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

Submission status: Accepted

Solution code:
from collections import Counter

N = int(input())
d_list = [int(input()) for _ in range(N)]
dlc = Counter(d_list)
ans = 0
for i in dlc.values():
    if i % 2 == 0:
        pass
    else:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
dct = {}
for _ in range(N):
    x = int(input())
    n = dct.get(x, 0) + 1
    dct[x] = n

ret = 0
for k, v in dct.items():
    if v % 2 == 1:
        ret += 1
print(ret)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
dic1 = dict()
for i in range(n):
    a = int(input())
    if a in dic1:
        dic1[a] += 1
    else:
        dic1[a] = 1
for i in dic1.values():
    ans += i%2
print(ans)

Submission status: Accepted

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

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

zisyo={}
for i in range(n):
    if a[i] in zisyo:
        zisyo.pop(a[i])
    else:
        zisyo[a[i]]=1
print(len(zisyo))

Submission status: Accepted

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

a.sort()

pre = 0
ans = 0
for i in range(n):
    count = 0
    if a[i] != pre:
        for j in range(i,n):
            if a[j] == a[i]:
                count += 1
            else:
                break
        if count % 2 == 0:
            pass
        else:
            ans += 1
        pre = a[i]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

n = int(input())
ans = 0
b = []

for i in range(n):
    ai = int(input())
    b.append(ai)

c = Counter(b)

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

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
a = int(input())
b = set()
for i in range(a):
	b ^= {input()}
print(len(b))

Submission status: Accepted

Solution code:
from collections import Counter
import sys

def read():
    return sys.stdin.readline().rstrip()

n = int(read())
a = Counter([int(read()) for _ in range(n)])
print(sum([ai % 2 for ai in a.values()]))

Submission status: Accepted

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

Submission status: Accepted

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

x = dict()
for i in range(N):
    if A[i] in x:
        if x[A[i]] == 1:
            x[A[i]] -=1
        else:
            x[A[i]] += 1
    else:
        x[A[i]] = 1
ans = 0
for idx in x:
    ans += x[idx]
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
A=[None]*N
for i in range(N):
  A[i]=input()
A.sort()
A.append('x')
cnt=0
c=A[0]
cc=1
for i in range(1,N+1):
  if A[i]==c:
    cc+=1
  else:
    cnt+=cc%2
    c=A[i]
    cc=1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())


ds = {}
for _ in range(N):
    A = input()
    if A not in ds:
        ds[A] = 0
    else:
        ds[A] += 1

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

Submission status: Accepted

Solution code:
N = int(input())


ds = {}
for _ in range(N):
    A = input()
    if A not in ds:
        ds[A] = 0
    else:
        ds[A] += 1

cnt = 0
for d in ds:
    if ds[d] % 2 == 0:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
N=int(input())
a =[]
for _ in range(0,N):
    a.append(int(input()))
b =[]
f=0
s=0
a.sort()
for i in range(0,N):
    if i==0:
        b.append(1)
    elif a[i]==a[i-1]:
        if b[f]==1:
            b[f]=0
        else:
            b[f]=1
    else:
        b.append(1)
        f=f+1
for i in range(0,len(b)):
    s=s+b[i]
print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n =  int(input())
dic = dict()
for j in range(n):
  i = int(input())
  if i in dic :
    if dic[i] == 1 :
      dic[i] = 0
    else:
      dic[i] = 1
  else :
    dic[i] = 1
print(sum(dic.values()))

Submission status: Accepted

Solution code:
N = int(input())
A = []
d = {}
for i in range(N):
    a = int(input())
    d[a] = 0
    A.append(a)
S = []
for i in range(N):
    if d[A[i]] == 0:
        S.append(A[i])
    d[A[i]] += 1
ans = 0
for i in S:
    ans += (d[i]%2)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
list=[]
ans=0
sa=1
sas=0
for i in range(n):
    a=int(input())
    list.append(a)
list=sorted(list)
list.append(10000000000)
for i in range(n+1):
    if i!=0:
        if list[i]==list[i-1]:
            sa+=1
        else:
            sas=sa
            sa=1
            if sas%2!=0:
                ans+=1
print(ans)

Submission status: Accepted

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

for i in range(n):
  test = int(input())
  if not(test in aDic.keys()):
    aDic[test] = 1
  elif aDic[test] == 1:
    aDic[test] = 0
  else:
    aDic[test] = 1

print(sum(aDic.values()))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
paper = {}
for i in range(n):
    number = input()
    if number in paper:
        del paper[number]
    else:
        paper[number] = 1
print(len(paper))

Submission status: Accepted

Solution code:
import sys

# N 数字の数
n = int(input())

# An お姉ちゃんの言う数字
a = [int(input()) for i in range(n)]

dic = {}

for i in a:
    if i in dic.keys():
        # あるので削除する
        dic.pop(i)
    else:
        dic[i] = i
        
print(len(dic))

Submission status: Accepted

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

cnt=defaultdict(lambda:0)
for i in a:
    if cnt[i]==0:
        cnt[i]=1
    else:
        cnt[i]=0

cnt=list(cnt.values())
print(cnt.count(1))

Submission status: Accepted

Solution code:
n = int(input())
al = list(int(input()) for _ in range(n))

s = set()

for a in al:
    s ^= {a}

print(len(s))

Submission status: Accepted

Solution code:
import math
import calendar
import fractions
import itertools

n = int(input())
a = []
for i in range(n):
    b = int(input())
    a.append(b)
a = sorted(a)
ans = 0
cnt = 0
for i in range(len(a)):
    if i == 0:
        cnt += 1
    else:
        if a[i] == a[i - 1]:
            cnt += 1
        else:
            if cnt % 2 == 1:
                ans += 1
                cnt = 1
            else:
                cnt = 1
if cnt % 2 == 1:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
import sys
n = int(input())
ans = []
for i in range(n):
    ans.append(int(input()))
ans.sort()
key = ans[0]
count = 1
ans_sum = 0
if len(ans) == 1:
    print(1)
    sys.exit()
for i in range(1,n):
    if key != ans[i]:
        key = ans[i]
        if count%2 == 0:
            count = 1
        else:
            count = 1
            ans_sum += 1
    else:
        count += 1
if count%2 == 0:
    count = 1
else:
    ans_sum += 1
print(ans_sum)

Submission status: Accepted

Solution code:
N = int(input())

paper = []
numbers = sorted([int(input()) for _ in range(N)])

# for n in numbers:
for i in range(N - 1):
    if numbers[i] == numbers[i + 1]:
        numbers[i] = -1
        numbers[i + 1] = -1
    if numbers[i] != -1:
        paper.append(numbers[i])

if numbers[N - 1] != -1:
    paper.append(numbers[N - 1])
print(len(paper))