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:
import collections
N = int(input())
A = [int(input()) for i in range(N)]
acount = collections.Counter(A)
a = acount.most_common()
count = 0
alen = len(a)
for j in range(alen):
    if a[j][1]%2 == 1:
        count+=1
print(count)

Submission status: Accepted

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

H = {}
R = 0

for a in A:
    if a in H.keys():
        del H[a]
        R -= 1
    else:
        H[a]  = True
        R    += 1

print(R)

Submission status: Accepted

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

count = 0
score = 0
A.sort()

for i in range(0, N):
    count += 1
    if A[i] != A[i+1]:
        score += count % 2
        count = 0

print(score)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n):
    if a[i] not in A:
        A.add(a[i])
    else:
        A.remove(a[i])
print(len(A))

Submission status: Accepted

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

n = int(input())
dic = {}
cou = 0
for _ in range(n):
    a = int(input())
    if a not in dic:
        dic[a] = 1
    else:
        dic[a] += 1
for a in dic:
    if dic[a] % 2 == 1:
        cou += 1

print(cou)

Submission status: Accepted

Solution code:
from collections import Counter

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

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

Submission status: Accepted

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

c = collections.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())
se = set()
for _ in range(n):
    se ^= {int(input())}

ans = len(se)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(len(A)):
    if A[i][1] % 2 == 1:
        B.append(A[i][1])
        
print(len(B))

Submission status: Accepted

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

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

main()

Submission status: Accepted

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

for _ in range(N):
    l.append(int(input()))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
s = set()
ans = 0
for _ in range(N):
    a = int(input())
    if a in s:
        s.remove(a)
        ans -= 1
    else:
        s.add(a)
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import sys
N = int(input())
A = [0]*N
s = set()
for i in range(N):
    A[i] = int(input())
    if(A[i] in s):
        s.remove(A[i])
    else:
        s.add(A[i])
print(len(s))

Submission status: Accepted

Solution code:
def ai():return input()#s
def a():return int(input())#a,n or k
def ma():return map(int, input().split())#a,b,c,d or n,k
def ms():return map(str, input().split())#,a,b,c,d
def lma():return list(map(int, input().split()))#x or y
def lms():return list(map(str, input().split()))#x or y
k= []
l = []
f = 0
def say(i):return print("Yes" if i == 0 else "No")
def Say(i):return print("YES" if i == 0 else "NO")

a = int(input())
c=set()
for i in range(a):
    t = int(input())
    if t in c:
        c.remove(t)
    else:
        c.add(t)
print(len(c))

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
s = {}
count = 0
for i in range(N):
    a = input()
    if a not in s:
        s[a] = 1
        count += 1
    elif s[a] % 2:
        s[a] += 1
        count -= 1
    else:
        s[a] += 1
        count += 1


print(count)

Submission status: Accepted

Solution code:
import sys
from collections import Counter

sys.setrecursionlimit(200000)


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


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


def solve():
    N = ii()
    A = imi(N)
    c = Counter(A)
    ans = 0
    for v in c.values():
        if v % 2 == 1:
            ans += 1
    return ans


if __name__ == "__main__":
    print(solve())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections

n = int(input())
nums = [int(input())for i in range(n)]
counterNums = collections.Counter(nums)

ans = 0
for v in counterNums.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)]
S = set()
for i in A:
    if i in S:
        S.remove(i)
    else:
        S.add(i)

print(len(S))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

count = 0
for i in b.values():
    if i%2==1:
        count += 1
print(count)

Submission status: Accepted

Solution code:
a=set()
N=input()

for i in range(N):
    A=input()
    if(A in a):
        a.remove(A)
    else:
        a.add(A)
        

print(len(a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

n = int(input())
A = [int(input()) for _ in range(n)]
ans = 0
for k, v in Counter(A).items():
    if v % 2 == 0:
        continue
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
import collections

N = int(input())
A = [int(input()) for i in range(N)]
ans = 0
num = collections.Counter(A).most_common()

for a, b in num:
    if b % 2 != 0:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n=int(input())

a=[]

for i in range(n):
    n=int(input())
    a.append(n)
    
import collections
l=collections.Counter(a)


ans=0

for i,j in l.most_common():
    if j%2==1:
        ans+=1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
b = {}
count = 0
for i in range(N):
    tmp = int(input())
    if tmp not in b:
        b[tmp] = 1
    else:
        b[tmp] += 1
for i in b:
    count += b[i]%2
print(count)

Submission status: Accepted

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

    for num in a_count:
        if a_count[num] % 2:
            ans += 1
    print(ans)


abc073_c()

Submission status: Accepted

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

memo = {}
for a in A:
  if(a not in memo):
    memo[a] = 0
  else:
    memo.pop(a)
print(len(memo))

Submission status: Accepted

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

if len(a)==1:
    print(1)
    exit(0)

a.sort()
ans=0

prev=a[0]
tmp=0

for i in range(n):
    if a[i]!=prev:
        if tmp%2==1:
            ans+=1
        tmp=1
    else:
        tmp+=1
    
    prev=a[i]

if tmp%2==1:
    ans+=1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

if len(a) == 1:
    print(1)
    exit(0)

a.sort()
ans = 0

prev = a[0]
tmp = 0

for i in range(n):
    if a[i] != prev:
        if tmp % 2 == 1:
            ans += 1

        tmp = 1

    else:
        tmp += 1

    prev = a[i]

if tmp % 2 == 1:
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
import sys
import collections
import itertools
import math
import re
from collections import Counter
from collections import deque
from collections import defaultdict
import bisect

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


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

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

print(ret)

Submission status: Accepted

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

A.sort()
prev = A[0]
tmp = 0
ans = 0
if len(A) == 1:
    print(1)
    exit()
for a in A:
    if a != prev:
        if tmp % 2 == 1:
            ans += 1
        tmp = 1
    else:
        tmp += 1
    prev = a
if tmp % 2 == 1:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    aa = [int(input()) for _ in range(n)]
    nums = dict()
    for a in aa:
        if not a in nums:
            nums[a] = True
        else:
            nums.pop(a)
    print(len(nums))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

import collections
c = collections.Counter(joisino)
ans = 0
for count in c.values():
  if count % 2 == 1:
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
s=set()
for _ in range(n):
    a = 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 = Counter([int(input()) for _ in range(n)])

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
a=[int(input()) for i in range(n)]
a=sorted(a)
x=a[0]
c=1
ct=0
for i in range(1,n):
  if a[i]==x:
    c+=1
    if i==n-1:
      if c%2==1:
        ct+=1
  else:
    if c%2==1:
      ct+=1
    x=a[i]
    c=1
    if i==n-1:
      ct+=1
print(ct)

Submission status: Accepted

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

Submission status: Accepted

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

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())
L = []
for i in range(N):
    a = int(input())
    L.append(a)

L.sort()
ptr = 0
temp = 0
num = 1
ans = 0
while ptr < N:
    cc = L[ptr]
    f = 0
    while ptr < N and L[ptr] == cc:#同じ数字が続く終了条件
        f += 1
        ptr += 1
    ans += f%2

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
s = set()
for _ 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 = [int(input()) for _ in range(N)]
s = set()
for a in A:
    s ^= set([a])
print(len(s))

Submission status: Accepted

Solution code:
from collections import Counter

n = int(input())
ans = 0
num_list = [int(input()) for _ in range(n)]
no_dups = Counter(num_list).most_common()

for num in reversed(no_dups):
    if num[1]%2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
d={}
for i in range(int(input())):
    i=int(input())
    if i not in d.keys():
    	d[i]=1
    else:
        del d[i]
print(len(d))

Submission status: Accepted

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

for _ in range(N):
    A = int(input())
    if A in maps:
        maps.pop(A)
    else:
        maps[A] = 1

print(len(maps))

Submission status: Accepted

Solution code:
n = int(input())
a = [0 for i in range(n)]
for i in range(n):
    a[i] = int(input())
if n == 1:
    print(1)
    exit()
a = sorted(a)
a.append(-1)  # 番兵を追加
written = []  # 最終的に描かれる数字の集合
counter = 1
# a[0]と同じ数字が途切れた時点でcounterが奇数なら追加する
for i in range(1, len(a)):  # n > 1の場合
    # print()
    # print("a[i]:{} a[i-1]:{} counter:{}".format(a[i], a[i-1], counter))
    if a[i] == a[i - 1]:
        counter += 1
    else:
        if counter % 2 == 1:
            written.append(a[i - 1])
        counter = 1
    # print("a[i]:{} a[i-1]:{} counter:{}".format(a[i], a[i - 1], counter))
print(len(written))
# print(written)
# print(a)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import collections
n = int(input())
a = []
for i in range(n):
    a.append(input())
# [d1, d2, d3, ..., dN]
a = [int(m) for m in a]#int型に直す
c = collections.Counter(a)
count = 0
for i in c:
    if c[i] % 2 != 0:
        count += 1
print(count)

Submission status: Accepted

Solution code:
import collections
ans = 0
n = int(input())
nums = [int(input()) for i in range(n)]
con = collections.Counter(nums)

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

Submission status: Accepted

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

Submission status: Accepted

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

l = 0
m = 1
ans = 0

for l in range(N-1):
	if A[l] == A[l+1]:
		m += 1
	else:
		ans += m%2
		m = 1
if A[N-1] != A[N-2]:
	ans += 1
else:
	ans += m%2
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
Sister={}
Paper=0
for i in range(N):
  index=int(input())
  if index not in Sister:
    Sister[index]=1
  else:
    Sister[index]+=1
for i in Sister:
  if Sister[i]%2==1:
    Paper+=1
print(Paper)

Submission status: Accepted

Solution code:
import collections

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

lc=collections.Counter(l)
L=lc.most_common()
#print(L)
ans=0
for j in range(len(L)):
    if L[j][1]%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)

import collections
A_c=collections.Counter(A)

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

Submission status: Accepted

Solution code:
N = int(input())
D = {}
for i in range(N) :
    index = int(input())
    if index not in D :
        D[index] = 1
    else :
        D[index] += 1
ans = 0
for i in D :
    if D[i] % 2 != 0 :
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import collections
N = int(input())
A = [None for i in range(N)]
for i in range(N):
    A[i] = int(input())
count = collections.Counter(A)
count = count.most_common()
ans = 0
for i in range(len(count)):
    if count[i][1] % 2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

n=int(input())
l=[int(input()) for i in range(n)]
ls=collections.Counter(l)
#print(ls)
a=0
for value in ls.values():
    if value%2==1:
        a+=1
print(a)

Submission status: Accepted

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

for a in A:
    if a in m:
        del m[a]
    else:
        m[a] = 1
print(len(m.keys()))

Submission status: Accepted

Solution code:
# encoding: utf-8
N = int(input())
A = [int(input()) for i in range(N)]

A.sort()

tag = -1
cnt = 0
ans = 0
for Ai in A:
    if Ai > tag:
        tag = Ai
        ans += cnt % 2
        cnt = 0
    cnt += 1
else:
    ans += cnt % 2
        
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

a = sorted(a)

ans = n
flag = 0
for i in range(1, n):
    if a[i] != a[i-1] or flag == 1:
        flag = 0
    else:
        flag = 1
        ans -= 2

print(ans)

Submission status: Accepted

Solution code:
from collections import Counter


def solve(N, As):
    c = Counter(As)
    return len([k for k, v in c.items() if v % 2 == 1])


if __name__ == "__main__":
    N = int(input())
    As = [int(input()) for _ in range(N)]
    print(solve(N, As))

Submission status: Accepted

Solution code:
d={}
N = int(input())
    
for i in range(N):
    b=int(input().strip())
    if b in d:
        d.pop(b)
    else:
        d[b]=-1
print(len(d))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def 解():
    iN = int(input())
    aA = [int(_) for _ in sys.stdin.readlines()]
    d = set()
    for a in aA:
        if a in d:
            d.remove(a)
        else:
            d.add(a)
    print(len(d))
解()

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(raw_input())
A = []
for i in range(N):
    A.append(int(raw_input()))

A.sort()
prev=A[0]
count=1
all_count=0
for i in range(1,N):
    if prev==A[i]:
        count+=1
    else:
        prev=A[i]
        all_count+=count%2
        count=1
all_count+=count%2

print all_count

Submission status: Accepted

Solution code:
H = dict([])
N = int(input())
L = [input() for _ in range(N)]

ctr = 0
for i in range(N):
    H[L[i]] = 0
    if len(H) == ctr:
        H.pop(L[i])
    ctr = len(H)
    
        
        
print(len(H))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
L = [int(input()) for i in range(N)]
L.sort()
res = 0
i = 0
while i < len(L)-1:
    if L[i] == L[i+1]:
        res += 2
        i += 1
    i += 1
    
print(len(L)-res)

Submission status: Accepted

Solution code:
N=int(input())
ans=0
dic={}
for i in range(N):
    a=int(input())
    if dic.get(a,0)==0:
        ans+=1
        dic[a]=1
    else:
        ans-=1
        dic[a]=0
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
An = []
for _ in range(N):
    An.append(int(input()))

ans_dict = {}
for A in An:
    if A in ans_dict:
        ans_dict[A] = abs(ans_dict[A] - 1)
    else:
        ans_dict[A] = 1

sum = 0
for i in ans_dict.values():
    sum += i

print(sum)

Submission status: Accepted

Solution code:
from collections import defaultdict
N = int(input())
D = defaultdict(int)
for i in range(N):
    D[int(input())] += 1
ans = 0
for key in D:
    if D[key] % 2 != 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
def main():
    N = int(input())

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

    # TimSortっていうMergeSortの改良版らしい
    paper.sort()

    preNum = paper[0]
    sameNumCount = 1
    ans = 0
    for num in paper[1:]:
        if preNum == num:
            sameNumCount += 1
        else:
            ans += sameNumCount % 2
            preNum = num
            sameNumCount = 1
    # 一番最後の判定
    if paper[-1] == preNum:
        ans += sameNumCount % 2

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())

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

print(len(p))

Submission status: Accepted

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

A = sorted(A)

x = A[0]
s = 0
c = 0
for i in range(N):
	if A[i] == x:
		c += 1
	else:
		x = A[i]
		if c % 2 == 1:
			s += 1
		c = 1

if c % 2 == 1:
	s += 1

print(s)

Submission status: Accepted

Solution code:
n = int(input())
d = {}
for _ in [0]*n:
  k = int(input())
  if k in d:
    d[k] = 1-d[k]
  else:
    d[k]=1
print(sum(d.values()))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections

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

dic = collections.Counter(A)

ans = 0
for k in dic.values():
    if k%2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
a = [int(input()) for _ in range(N)]
a.sort()
ans = 0
now = 0
cnt = 0
for x in a:
    if x == now:
        cnt += 1
        continue
    if cnt % 2 == 1:
        ans += 1
    cnt = 1
    now = x
if cnt % 2 == 1:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

kami = set([])
for i in range(N):
    A = int(input())
    if A not in kami:
        kami.add(A)
    else:
        kami.remove(A)

print(len(kami))

Submission status: Accepted

Solution code:
N = int(input())

l = set([])
for _ 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:
n = int(input())
a = set([])
for i in range(n):
  k = int(input())
  if k in a:
    a.remove(k)
  else:
    a.add(k)
ans = len(a)
print(ans)

Submission status: Accepted

Solution code:
list_a = []
n = int(input())
for i in range(n):
    list_a.append(int(input()))
dict_ans = {}
for i in range(n):
    try:
        del dict_ans[list_a[i]]
    except KeyError:
        dict_ans[list_a[i]] = 1
print(len(dict_ans))

Submission status: Accepted

Solution code:
# coding:utf-8

INF = float('inf')


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


N = int(input())
number = {}
for i in range(N):
    a = input()
    if a not in number:
        number[a] = 1
    else:
        number[a] += 1

ans = 0
for a in number:
    if number[a] % 2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

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

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

print(num)

Submission status: Accepted

Solution code:
def fa(): #final answer
    global ans
    print(ans)
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))

N = getN()
space = {}

for i in range(N):
    k = getN()
    if k in space:
        space[k] = space[k] ^ 1
    else:
        space[k] = 1


print(sum(space.values()))

Submission status: Accepted

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


def main():
    from collections import Counter

    n = int(input())
    a = Counter([int(input()) for _ in range(n)])
    ans = 0

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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

from collections import Counter

n = ni()
a = [ni() for _ in range(n)]

cnt = Counter(a)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = {}
for i in range(n):
    x = int(input())
    a[x] = a.get(x, 0) + 1
ans = 0
for k in a:
    ans += a[k] % 2
print(ans)

Submission status: Accepted

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

index=0
while index < n:
   listForA.append(int(input()))
   index+=1

listForA.sort()
index2 =0
beforeC=""
count=0
allCount=0
while index2 < n:
    if index2==0:
        beforeC=listForA[index2]
        count=1
    else:
        if beforeC == listForA[index2]:
            count+=1
        else:
            if count%2==1:
                allCount+=1
            beforeC = listForA[index2]
            count=1
    index2+=1
if count%2==1:
    allCount+=1

print(allCount)

Submission status: Accepted

Solution code:
N = int(input())
A = [int(input()) for i in range(N)]
A.sort()
j = 1
J = 1
ans = 0
for j in range(1,len(A)):
  if (A[j-1] == A[j]):
    J += 1
  else:
    if (J%2 != 0):
      ans += 1
      J = 1
    else:
      J = 1
if (J%2 != 0):
  ans += 1
print(ans)

Submission status: Accepted

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

N_dict = {}
count = 0

for a in A:
    if a not in N_dict:
        count += 1
        N_dict[a] = 1
    elif N_dict[a] % 2 == 0:
        count += 1
        N_dict[a] += 1
    else:
        count -= 1
        N_dict[a] += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = []
for i in range(N):
    A.append(int(input()))
A.sort()
i = 1
cnt = 1
ans = 0
while True:
    if i >= len(A):
        break
    if A[i] == A[i - 1]:
        cnt += 1
    else:
        if cnt % 2 != 0:
            ans += 1
        cnt = 1
    i += 1
if cnt % 2 != 0:
    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 key in c.keys():
    if c[key] & 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
#ABC073C
N=int(input())
A=[int(input()) for i in range(N)]
A_sorted=sorted(A)
count=1
ans=0
for i in range(N-1):
    if A_sorted[i]==A_sorted[i+1]:
        count+=1
    else:
        ans+=count%2
        count=1
ans+=count%2
print(ans)

Submission status: Accepted

Solution code:
import sys
from collections import Counter

input = sys.stdin.readline

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

ans = len([v for v in Counter(A).values() if v % 2 == 1])
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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