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 = [int(input()) for _ in range(N)]
A.sort()

res = 0
cnt = 0
if N == 1:
    res = 1
for i in range(N):
    if i == 0:
        cnt = 1
    else:
        if A[i-1]==A[i]:
            cnt += 1
            if i == N-1:
                res += cnt%2
        else:
            res += cnt%2
            cnt = 1
            if i == N-1:
                res += 1
print(res)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
#ABC070C
import math

n = int(input())

t=[]
for i in range(0,n):
	t.append(0)
for i in range(0,n):
    t[i] = int(input())
t.sort()

sum=0
tmp=t[0]
tmpnum=1
for i in range(1,n):
	if(t[i]==tmp):
		tmpnum+=1
	else:
		tmp=t[i]
		sum+=tmpnum%2
		tmpnum=1
	if(i==n-1):
		sum+=tmpnum%2
print(sum)

Submission status: Accepted

Solution code:
import collections
n=int(input())
l=[int(input()) for _ in range(n)]
c=collections.Counter(l)
mc=c.most_common()
print(sum([i[1]%2==1 for i in mc]))

Submission status: Accepted

Solution code:
a = int(input())
b = {}
for i in range(a):
    c = int(input())
    if c not in b:
        b[c] = 1
    else:
        b[c] += 1
c = 0
for k, v in b.items():
    if v % 2 != 0:
        c += 1
print(c)

Submission status: Accepted

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

a_c = Counter(a)
a_v = list(a_c.values())

cnt = 0
for a_item in a_v:
    if a_item % 2 == 1:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
a = set()
for _ 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:
import sys

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



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from collections import defaultdict
import sys
n = int(input())
a = tuple(map(int,sys.stdin))
d = defaultdict(int)
for i in a:
  d[i] += 1
c = 0
for i in d.values():
  if i % 2 == 1:
    c += 1
print(c)

Submission status: Accepted

Solution code:
import collections
N=int(input())
A=[int(input()) for _ in range(N)]
AA=collections.Counter(A)
AA=sorted(list(AA.items()))
ans=0
for i,j in AA:
  if j%2!=0:
    ans+=1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

counter_hash = {}


for i in A:
        if i in counter_hash:
                counter_hash[i] = (counter_hash[i] + 1) % 2
        else:
                counter_hash[i] = 1
        
print(sum(counter_hash.values()))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#ABC73 C

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

a = Counter(a)
a = list(a.items())

ans = 0
for i,j in a:
    if j % 2 == 0:
        continue
    else:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict

n = int(input())
D = defaultdict(lambda: 0)
for _ in range(n):
    a = int(input())
    D[a] ^= 1
print(sum(D.values()))

Submission status: Accepted

Solution code:
n = int(input())

a = [] 

[a.append(int(input()))  for i in range(n)]
a.sort()
    
#print (a)

ans = 0
i = 0

while(i<n):
    chk = a[i]
    tmp = 1
    while(i+tmp < n and chk == a[i+tmp]):
        tmp += 1
    ans += (tmp)%2
    i += tmp
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
cnt={}
for i in range(N):
  A=int(input())
  if A in cnt:
    cnt[A]+=1
  else:
    cnt[A]=1
result=list(cnt.values())
print(len([i for i in result if i%2==1]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys

sys.setrecursionlimit(10**7)


def read_h(typ=int):
    return list(map(typ, input().split()))


def read_v(n, m=1, typ=int):
    return [read_h() if m > 1 else typ(input()) for _ in range(n)]


def main():
    N, = read_h()
    A = read_v(N)

    cnts = {}
    for a in A:
        cnts[a] = cnts.get(a, 0) + 1

    #  print(cnts)

    ans = 0
    for n in cnts.values():
        if n % 2 != 0:
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from collections import Counter
n=int(input())
l=[int(input()) for i in range(n)]
L=Counter(l)
print(sum(1 for i in L.values() if i%2==1))

Submission status: Accepted

Solution code:
N = int(input())
A = {}
for i in range(N):
    a = input()
    A.setdefault(a, 0)
    A[a] = 1 - A[a]
print(sum(A.values()))

Submission status: Accepted

Solution code:
# ABC073-C
N =int(input())
A = []
for i in range(N):
    A.append(int(input()))
A.sort()
for i in range(N-1):
    if A[i] == A[i+1]:
        A[i] = 0
        A[i+1] = 0
A = set(A)
if 0 in A:
    print(len(A) - 1)
else:
    print(len(A))

Submission status: Accepted

Solution code:
N = int(input())
A = [input() for i in range(N)]
A = list(map(int, A))
A.sort()
count = 0
ans = 0
i = 0
while i < N:
    target = A[i]
    j = i
    while j < N:
        if target == A[j]:
            count += 1
            i += 1
            j += 1
        else:
            break
    if count % 2 == 1:
        ans += 1
    count = 0
print(ans)

Submission status: Accepted

Solution code:
# 操作回数を入力する
N = int(input())
# 言う数字を入力する
list_A = [int(input()) for _ in range(N)]
# 数字を昇順に並べる
list_A.sort()
# 終了後に残っている数字の数を設定する
ans = 0
# 直前の数字を設定する
num = 0
# ある数字が連続している回数を設定する
count = 0
# 昇順に並んだ各数字Aについて、、
for A in list_A:
    # 数字Aが直前の数字と同じ場合、、
    if A == num:
        # 連続回数を増やす
        count += 1
    # 数字Aが直前の数字と異なる場合、、
    else:
        # 直前の数字の連続回数が奇数の場合、、
        if count % 2 != 0:
            # 終了後に残っている数字の数を増やす
            ans += 1
        # 直前の数字と連続回数を更新する
        num = A
        count = 1        
# 最後の数字について、連続回数が奇数の場合、終了後に残っている数字の数を増やす
if count % 2 != 0:
    ans += 1
# 結果を出力する
print(ans)

Submission status: Accepted

Solution code:
import bisect
# 操作回数を入力する
N = int(input())
# 言う数字を入力する
list_A = [int(input()) for _ in range(N)]
# 紙の状態を設定する
paper = []
# 
for A in list_A:
    if paper == []:
        paper.append(A)
        continue
    # 紙上のAをニ分探索する
    index = bisect.bisect_left(paper, A)
    if index < len(paper) and paper[index] == A:
        del paper[index]
    else:
        paper.insert(index, A)
# 結果を出力する
print(len(paper))

Submission status: Accepted

Solution code:
N = int(input())
A = {}
for i in range(N):
    a = input()
    A.setdefault(a, 0)
    A[a] = 1 - A[a]
print(sum(A.values()))

Submission status: Accepted

Solution code:
N = int(input())
dic = {}
for _ in range(N):
    a = int(input())
    dic[a] = dic.get(a,0) + 1
g = 0
for c in dic.keys():
    if dic[c] % 2 == 1:g += 1
print(g)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

n = int(input())
num_list = sorted([ int(input()) for i in range(n)])
num_list_2 = []

for i in range(n):
    if i == 0:
        num_list_2.append([num_list[i]])
    else:
        if num_list[i-1] == num_list[i]:
            num_list_2[-1].append(num_list[i])
        else:
            num_list_2.append([num_list[i]])



num_list_2 = [ len(i)%2 for i in num_list_2 ]
print(sum(num_list_2))

Submission status: Accepted

Solution code:
import collections

N = int(input())
W = [int(input()) for _ in range(N)]
c = collections.Counter(W)
print(len([i for i in c.values() if i % 2 != 0]))

Submission status: Accepted

Solution code:
n=int(input())
a=list(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==0:
            cnt=1
        else:
            ans+=1
            cnt=1
if a[-2]==a[-1]:
    if cnt%2==1:
        ans+=1
else:
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
alist = sorted([int(input()) for x in range(N)])

tmpNum = alist[0]
cnt = 1
ans = 0
for i in range(1, N):
	num = alist[i]
	if tmpNum == num:
		cnt = cnt + 1
		if i == N-1 and cnt % 2 != 0:
			ans = ans + 1
	else:
		if cnt % 2 != 0:
			ans = ans + 1
		tmpNum = num
		cnt = 1
		if i == N-1:
			ans = ans + 1

if len(alist) == 1:
	ans = ans + 1


print(ans)

Submission status: Accepted

Solution code:

N = int(input())
dic = {}

for i in range(N):

    A = input()

    if A 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:
from collections import Counter
n=int(input())
A=Counter([int(input()) for i in range(n)])
ans=0
for e in A:
    if A[e]%2==1:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter

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

cnt = Counter(A)

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

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

from collections import Counter

N = int(input())
arr = [int(input()) for i in range(N)]
dic = Counter(arr)
ctr = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
b=set()
n,*a=map(int,open(0).read().split())
for i in a:
    if i not in b:
        b.add(i)
    else:
        b.remove(i)
print(len(b))

Submission status: Accepted

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

dict={}
for i in range(n):
    if not a[i] in dict or dict[a[i]]==0:
        dict[a[i]]=1
    else:
        dict[a[i]]=0

ans=0
for i in dict.values():
    ans+=i
print(ans)

Submission status: Accepted

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

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


for i in range(N):
    if A[i] > 0:
        A[i] = 1

# print(A)
print(sum(A))

Submission status: Accepted

Solution code:
from collections import defaultdict

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

C = defaultdict(int)
for a in A:
    C[a] += 1

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

print(ans)

Submission status: Accepted

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

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

print(len(a))

Submission status: Accepted

Solution code:
N=int(input())
Paper={}
for _ in range(N):
    a=int(input())
    if a in Paper:del Paper[a]
    else:Paper[a]=1
print(len(Paper.keys()))

Submission status: Accepted

Solution code:
data=[int(input()) for i in range(int(input()))]
data.sort()
count=-1
value=1
predata=None
for i in range(0,len(data)):
    if predata!=data[i]:
        count+=value%2
        value=1
    else:
        value+=1
    predata=data[i]
count+=value%2
print(count)

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 i in d.values():
    if i%2==1:
        ans+=1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = []
d={}
for i in range(n):
    x = int(input())
    a.append(x)
for i in range(len(a)):
    d[a[i]]=0
for i in range(len(a)):
    d[a[i]]+=1
l = 0
for key in d:
    l+=(d[key]%2)
print(l)

Submission status: Accepted

Solution code:
# 連想配列使用ver
import sys

input=sys.stdin.readline

n=int(input())

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

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

Submission status: Accepted

Solution code:
# Counter使用ver
import sys
from collections import Counter

input=sys.stdin.readline

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

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

Submission status: Accepted

Solution code:
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

N = n()
As = []
memo = set()
for i in range(N):
    A = n()
    if A in memo:
        memo.remove(A)
    else:
        memo.add(A)

print(len(memo))

Submission status: Accepted

Solution code:
# 最後に残るのは奇数回登場したやつ
n = int(input())
hash = dict()
for _ in range(n):
    x = int(input())
    if x in hash:
        hash[x] += 1
    else:
        hash[x] = 1

ans = 0
for _, v in hash.items():
    if v % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
# 2019/06/23
# AtCoder Beginner Contest 073 - C

# Input
n = int(input())
adict = {}

for i in range(n):
    a = input()
    if adict.get(a) == None:
        adict[a] = 1
    else:
        adict[a] += 1

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

# Output
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
l = []
for _ in range(N):
    l.append(int(input()))

import collections
cnt = 0
c = collections.Counter(l)
c = c.most_common()
print(len([i for i in c if i[1]%2 == 1]))

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
nums = [int(input()) for _ in range(n)]
dc = {}
for i in range(n):
  if not nums[i] in dc:
    dc[nums[i]] = 1
  else:
    del dc[nums[i]]

print(len(dc))

Submission status: Accepted

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

a.sort()
a.append(0)
erased = 0
ans = 0
for i in range(1,n+1):
    if a[i-1] == a[i]:
        erased = (erased+1)%2
    else:
        if erased == 0:
            ans += 1
        erased = 0
print(ans)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    A.sort()
    t = A[0]
    ans = 1
    for i in range(1, N):
        t -= A[i]
        if t == 0:
            ans -= 1
        else:
            t = A[i]
            ans += 1
    print(ans)


main()

Submission status: Accepted

Solution code:
N = int(input())
j_dic = {}
for _ in range(N):
    A = int(input())
    j_dic[A] = (j_dic.get(A,0) + 1)%2

ans = 0
for key in j_dic:
    if j_dic[key] == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ans = {}
for i in range(N):
  ai = int(input())
  if ans.get(ai):
    ans.pop(ai)
  else:
    ans[ai] = 1
print(len(ans))

Submission status: Accepted

Solution code:
N = int(input())
#言われた数字を1つの配列にまとめて昇順にする
A = []
for i in range(N):
    A.append(int(input()))
A.sort()
index = 0
n = 0
while index < N:
    s = A[index]
    count = 0
    while index < N and A[index] == s:
        count += 1
        index += 1
    n += count % 2
print(n)

Submission status: Accepted

Solution code:
n = int(input())
num = set()
ans = 0

for i in range(n):
    a = int(input())
    if a in num:
        num.remove(a)
        ans -= 1
    else:
        num.add(a)
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict

def main():
    num = int(input())
    count = defaultdict(int)
    for i in range(num):
        data = int(input())
        count[data] += 1

    ans = 0
    for i, v in count.items():
        if v % 2 == 1:
            ans += 1
    print(ans)



if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

ans = [input() for i in range(n)]

ans.sort()

s = sorted(set(ans))
t = 0
cnt = 0

result = 0
for i in range(n):
    temp = s[t]
    if ans[i] == temp:
        cnt += 1
    else:
        if cnt % 2 == 1:
            result += 1
        cnt = 1
        t += 1
else:
    if cnt % 2 == 1:
        result += 1
        
    
    

print(result)

Submission status: Accepted

Solution code:
N=int(input())
L=[0]*N
for i in range(N):
    L[i]=int(input())
L.sort()
ans=0
count=0
past=L[0]
for i in range(0,N):
    if L[i]==past:
        count+=1
    else:
        past=L[i]
        ans+=count%2
        count=1

print(ans+count%2)

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())
lst = [0]
for i in range(N):
	lst += [int(input())]

lst.sort()

lst += [0]
ans = 0
count = 0
for i in range(1,N+2):
	if lst[i] != lst[i-1]:
		ans += count%2
		count = 1
	else:
		count += 1	
print (ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

from collections import defaultdict

N = int(input())

d = defaultdict(int)
for _ in range(N):
    a = int(input())
    d[a] += 1

count = 0
for key in d.keys():
    if d[key] % 2 == 1:
        count += 1
        
print(count)

Submission status: Accepted

Solution code:
N = int(input())
para = {}
for i in range(N):
    a = int(input())
    if not a in para.keys() :
        para[a] = 1
    else : para[a] += 1
ans = []
def judge(a) :
    for i in a.keys():
        if a[i] % 2 == 0 : pass
        else : ans.append(1)
    return sum(ans)

print("{}".format(judge(para)))

Submission status: Accepted

Solution code:
n=int(input())
l=[int(input()) for i in range(n)]
dic={}
for i in set(l):
	dic[i]=0
for i in l:
	dic[i]+=1
cnt=0
for v in dic.values():
	if v%2==1:cnt+=1
print(cnt)

Submission status: Accepted

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

ans = 0
dic = {}

for a in A:
    if a in dic:
        dic[a] = (dic[a]+1)%2
    else:
        dic[a] = 1
print(sum(list(dic.values())))

Submission status: Accepted

Solution code:
###template###
import sys
def input(): return sys.stdin.readline().rstrip()
def mi(): return map(int, input().split())
###template###

N = int(input())

nset = set()

for _ in range(N):
  i = int(input())
  if i in nset: nset.remove(i)
  else: nset.add(i)

print(len(nset))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(N: int, A: "List[int]"):
    s = set()
    for a in A:
        if a in s:
            s.remove(a)
        else:
            s.add(a)
    ret = len(s)
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  n=I()

  l=[I() for _ in range(n)]

  l.sort()

  l2=[]
  for x in l:
    if len(l2)>0:
      if x==l2[-1]:
        l2.pop()
      else:
        l2.append(x)
    else:
      l2.append(x)

  return len(l2)

print(main())

Submission status: Accepted

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict
inf=float('inf')
mod = 10**9+7
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N = I()
    A = set()
    for _ in range(N):
        a = I()
        if a in A:
            A.remove(a)
        else:
            A.add(a)
    print(len(A))
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:


def do():
    di = {}
    N = int(input())
    for _ in range(N):
        temp = int(input())
        if temp not in di:
            di[temp] = 1
        else:
            di[temp] += 1
    ans = 0
    for k,v in di.items():
        if v % 2 == 1:
            ans += 1
    print(ans)



if __name__ == "__main__":
    do()

Submission status: Accepted

Solution code:
N = int(input())
numbers = []
for i in range(0, N):
	numbers.append(int(input()))
numbers.sort()
ans = 0
tmp = 0
cnt = 0
for i in range(0, N):
	if numbers[i] != tmp:
		ans += cnt%2
		cnt = 0
		tmp = numbers[i]
	cnt += 1
ans += cnt%2
print(ans)

Submission status: Accepted

Solution code:
l = input().split()
N = int(l[0])
A = []

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

# print(N, A)

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

sum = 0
for b in B:
    sum += B[b] % 2

print(sum)

Submission status: Accepted

Solution code:
N = int(input())

a_dict = {}
for i in range(N):
  t = int(input())
  if t in a_dict:
    a_dict[t] += 1
  else:
    a_dict[t] = 1
print(len([0 for i in a_dict.values() if i % 2]))

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

print(len(A))

Submission status: Accepted

Solution code:
# 要素であるかの確認は配列じゃなくsetを使う
# setはハッシュで実装されているため

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:
from collections import Counter
n = int(input())
a = [int(input()) for _ in range(n)]

cnt = Counter(a).values()


flg = 0
for i in cnt:
    if i%2 == 1:
        flg += 1

print(flg)

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:
import collections
import sys
input = sys.stdin.readline

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

Submission status: Accepted

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

for i in range(N):
  tmp = int(input())
  A.append(tmp) 
B = Counter(A).values()
cnt = 0
for i in B:
  if i % 2 != 0:
    cnt += 1
  
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
A = [int(input()) for i in range(n)]
dict_a = {}
for a in A:
  dict_a.setdefault(a, 0)
  if dict_a[a] == 1:
    dict_a.pop(a)
  else:
    dict_a[a] += 1
print(len(dict_a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

n = int(input())
arr = Counter([input() for _ in range(n)])
print(sum(1 if count%2 else 0 for count in arr.values()))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict

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

d = defaultdict(int)

for a in A:
  d[a] ^= 1

answer = sum(d.values())
print(answer)

Submission status: Accepted

Solution code:
# ABC073C - Write and Erase
import sys
input = sys.stdin.readline

n = int(input())
arr = set()
for _ in range(n):
    m = int(input())
    if m in arr:
        arr.remove(m)
    else:
        arr.add(m)
print(len(arr))

Submission status: Accepted

Solution code:
n = int(input())

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

a = sorted(a)


temp = a[0]
c = 0

cnts = [0]*n

for i in a:
    if temp == i:
        cnts[c] += 1
    
    else:
        temp = i
        c += 1
        cnts[c] += 1

ans = 0

for i in cnts:
    if i%2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

a = sorted(a)


temp = a[0]
c = 0

cnts = [0]*n

for i in a:
    if temp == i:
        cnts[c] += 1
    
    else:
        temp = i
        c += 1
        cnts[c] += 1

ans = 0

for i in cnts:
    if i == 0:
        break

    if i%2 == 1:
        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,j in D.items():
    if j%2==1:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from bisect import bisect_left, bisect_right
import sys


def count(seq, element):
    "Return number of occurrences of item"
    i = bisect_left(seq, element)
    j = bisect_right(seq, element)
    return seq[i:j].count(element)


def solve(N: int, A: "List[int]"):
    ans = 0
    seta = sorted(list(set(A)))
    sa = sorted(A)
    for a in seta:
        if count(sa, a) % 2 != 0:
            ans += 1
    print(ans)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

print(sum(a.values()))

Submission status: Accepted

Solution code:
N = int(input())

def main():
    d = {}
    for _ in range(N):
        n = input()
        if not n in d.keys():
            d[n] = 0
        d[n] += 1
    
    ans = sum(map(lambda v: v % 2, d.values()))
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from collections import Counter
N, *A = map(int, open(0).read().split())
print(sum([1 for v, c in Counter(A).most_common() if c % 2 == 1]))

Submission status: Accepted

Solution code:
n=int(input())

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

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

Submission status: Accepted

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

from collections import Counter
A=Counter(A)
print(sum([1 for a in A.keys() if A[a]%2==1]))

Submission status: Accepted

Solution code:
from collections import Counter

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

A_cnt = list(Counter(A).values())
A_cnt_parity = list(map(lambda x: x%2, A_cnt))
ans = A_cnt_parity.count(1)

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
di = {}
for _ in range(N):
    i = int(input())
    if(i in di):
        del di[i]
    else:
        di[i]=1
print(len(di))

Submission status: Accepted

Solution code:
from collections import Counter
l=[int(input()) for i in range(int(input()))]
ca=Counter(l).most_common()
x=0
for i,j in ca:
    if j%2==1:x+=1
print(x)

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
a = Counter(list(int(input()) for i in range(n)))
print(sum(x % 2 != 0 for x in a.values()))

Submission status: Accepted

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