Problem:


Score : 300 points

Problem Statement

You are playing the following game with Joisino.

Initially, you have a blank sheet of paper.

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

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

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

Constraints

1≤N≤100000

1≤A_i≤1000000000(=10^9)

All input values are integers.

Input

Input is given from Standard Input in the following format:

N
A_1
:
A_N

Output

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

Sample Input 1

3
6
2
6

Sample Output 1

1

The game proceeds as follows:

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

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

6 is written on the sheet, so erase 6.

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

Sample Input 2

4
2
5
5
2

Sample Output 2

0

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

Sample Input 3

6
12
22
16
22
18
12

Sample Output 3

2



Sample input:
3
6
2
6


Sample output:
1

Submission status: Accepted

Solution code:
from collections import Counter

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

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

Submission status: Accepted

Solution code:
import sys
a =set()
n = int(sys.stdin.readline())
for _ in range(n):
    tmp = int(sys.stdin.readline()) 
    if tmp in a:
        a.remove(tmp)
    else:
        a.add(tmp)
print(len(a))

Submission status: Accepted

Solution code:
a =set()
n = int(input())
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:
from collections import Counter
a =[]
n = int(input())
for _ in range(n):
    a.append(int(input()))
b = Counter(a).values()
print(sum([i % 2 for i in b]))

Submission status: Accepted

Solution code:
N = int(input())
lst_a = [int(input()) for _ in range(N)]
lst_a.sort()
set_ans = set()


for a in lst_a:
    if a in set_ans:
        set_ans.remove(a)
    else:
        set_ans.add(a)
ans = len(set_ans)


print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict
d = defaultdict(int)

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

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

print(cnt)

Submission status: Accepted

Solution code:
from collections import Counter


N = int(input())
lst_number = [int(input()) for _ in range(N)]
set_number = set(lst_number)
cnt_number = Counter(lst_number)
ans = 0


for key in set_number:
    if cnt_number[key] % 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] = (d[A]+1) % 2
print(sum(d.values()))

Submission status: Accepted

Solution code:
n = int(input())
count = {}
for _ in range(n):
    a = int(input())
    if a not in count:
        count[a] = 1
    else:
        count[a] = 1 - count[a]
ans = 0
for i, c in count.items():
    ans += c
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
dic = {}
for _ in range(N):
    A = int(input())
    if A in dic:
        dic.pop(A)
    else:
        dic[A] = 1
print(len(dic))

Submission status: Accepted

Solution code:
import collections
N = int(input())
A = [int(input()) for _ in range(N)]
L = collections.Counter(A).most_common()
ans = 0
for item,num in L:
    if num % 2 != 0:
        ans += 1
print(ans)

Submission status: Accepted

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

print(len(a))

Submission status: Accepted

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
import math
from collections import defaultdict


An = defaultdict()
for _ in range(int(input())):
  i = int(input())
  if i not in An:
    An[i] = 1
  else:
    An[i] += 1

ans = 0
for i in An:
  ans += An[i]%2
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
N = int(input())
A = [int(input()) for _ in range(N)]
A.sort()
stack = A[0]
count_num = 1
ans = 0
for i in range(1,N):
        if A[i] == stack:
                count_num += 1
        else:
                if count_num % 2 == 1:
                        ans += 1
                count_num = 1
        stack = A[i]
if count_num%2 == 1:
        ans +=1
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
l=[]
for i in range(n):
  m=int(input())
  l.append(m)
l=sorted(l)
c=0
d=1
e=l[0]
for i in range(1,n):
  if l[i]!=e:
    if d%2==1:
      c+=1
    e=l[i]
    d=1
  else:
    d+=1
if d%2==1:
  c+=1
print(c)

Submission status: Accepted

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

#print(n,a)
for i in range(n):
  a=input()
  if a in mydict:
    del mydict[a]
  else:
    mydict[a]=1
    
print(len(mydict))

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:
n=int(input())
mydict={}

for i in range(n):
  a=int(input())
  if a in mydict:
    if mydict[a]==1:
      mydict[a]=0
    else:
      mydict[a]=1
  else:
    mydict[a]=1
    
#print(mydict)
mylist=mydict.values()

print(sum(mylist))

Submission status: Accepted

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

Submission status: Accepted

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

l.sort()

for i in range(1,n):
    if l[i] == l[i-1]:
        l[i] = 0
        l[i-1] = 0

print(len(l) - l.count(0))

Submission status: Accepted

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

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

s = set()

for v in L:
    if v in s:
        s.remove(v)
    else:
        s.add(v)
        
print(len(s))

Submission status: Accepted

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

def solve():
    """ 
    dic[a] := 数字aが紙に書かれているか否か（True/False）
    """
    N = int(input())
    dic = {}
    for i in range(N):
        a = int(input())
        if not a in dic:
            dic[a] = True
            continue
        if dic[a] == True:
            dic[a] = False
        else:
            dic[a] = True
    
    ans = 0
    for key in dic:
        if dic[key]: ans += 1
    print(ans)

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

m = {}
for a in A:
	if not a in m:
		m[a] = 1
	else:
		del m[a]

print(len(m))

Submission status: Accepted

Solution code:
from collections import Counter
print(len([x for x in Counter([input() for _ in range(int(input()))]).values() if x % 2 == 1]))

Submission status: Accepted

Solution code:
N = int(input())
dic = {} 
for i in range(N):
  num = int(input())
  if dic.get(num) is None:
    dic[num] = 1
  else:
    dic[num] += 1
ans = 0
for k in dic:
  if dic[k] %2 != 0:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = [int(input()) for _ in range(N)]
A.sort()
c = 1
ans = 0
for i in range(N-1):
  if A[i] == A[i+1]:
    c += 1
  else:
    if c % 2 == 1:
      ans += 1
    c = 1
if c % 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(len(paper))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter


N = int(input())
A = []
for i in range(N):
    A.append(int(input()))
A_cnt = Counter(A)
ans_sum = 0
for key, val in A_cnt.items():
    if val % 2 == 1:
        ans_sum += 1
print(ans_sum)

Submission status: Accepted

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

paper = set()
for a in A:
    paper ^= {a}

print(len(paper))

Submission status: Accepted

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

A.sort()

result = 0
cur = 0
while cur < N:
    a = A[cur]
    count = 0
    while cur < N and A[cur] == a:
        cur += 1
        count += 1
    result += count % 2

print(result)

Submission status: Accepted

Solution code:
from collections import Counter

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

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

A = Counter(A).most_common()

count = 0
for i, j in A:
    if j % 2 == 1:
        count += 1

print(count)

Submission status: Accepted

Solution code:
N = int(input())
A = [int(input()) for _ in range(N)]
A.sort()
A.append(10**9+1)

now = 0
cnt = 0
ans = 0
for a in A:
    if a == now:
        cnt += 1
    else:
        now = a
        ans += cnt % 2
        cnt = 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:

def read_input():
    n = int(input())
    alist = []

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

    return n, alist


def submit():
    n, alist = read_input()

    paper = {a: -1 for a in alist}

    for a in alist:
        paper[a] *= -1

    paper_write = [t for t in paper.items() if t[1] == 1]
    print(len(paper_write))

if __name__ == '__main__':
    submit()

Submission status: Accepted

Solution code:
N = int(input())
d = {}
for i in range(N):
    a = input()
    if not(a in d.keys()):
        d[a] = 0
    d[a] += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

target = {}
 
for i in A:
    if i in target:
        target[i] += 1
    else:
        target[i] = 1

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

Submission status: Accepted

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n = f()[0]
    s = set()
    for i in range(n):
        x = f()[0]
        if x not in s:
            s.add(x)
        else:
            s.remove(x)
    
    print(len(s))


solve()

Submission status: Accepted

Solution code:
from functools import reduce
import collections
import math

def main():
    # 文字列の2進数を数値にする
    # '101' → '5'
    # 文字列の頭に'0b'をつけてint()にわたす
    # binary = int('0b'+'101',0)

    # 2進数で立っているbitを数える
    # 101(0x5) → 2
    # cnt_bit = bin(5).count('1')
    
    # N! を求める
    # f = math.factorial(N)

    # N の逆元
    # N_inv = pow(N,MOD-2,MOD)

    # nCr
    # Nの階乗 * rの階乗の逆元 * n-rの階乗の逆元
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    INF = float("inf")

    # 大きな素数
    MOD = 10**9+7
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    N = int(input())
    a = []
    d = collections.defaultdict(int)
    for i in range(N):
        a.append(int(input()))
        d[a[i]] +=1
    ans = 0
    for d_i in d.items():
        if d_i[1] % 2 ==1:
            ans +=1
    print(ans)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from collections import Counter
N=int(input())
A=[int(input()) for _ in range(N)]
c=list(Counter(A).most_common())
ans=0
for a,b in c:
    if b%2!=0:
        ans+=1
    else:
        continue
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:
s={0}
for _ in[0]*int(input()):
  t=int(input())
  if t in s:s-={t}
  else:s|={t}
print(len(s)-1)

Submission status: Accepted

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

target = {}

for i in A:
    if i in target:
        target[i] += 1
    else:
        target[i] = 1

ans = 0
for i in target:
    if target[i] % 2 == 0:
        continue
    else:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy
import collections
from operator import itemgetter
#以下てんぷら
def j(q):
    if q==1: print("Yes")
    else:print("No")
    exit(0)


def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")

def ip():
    return int(input())
def printrow(a):
    for i in range(len(a)):
        print(a[i])
def combinations(n,r):
    if n<r:return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def permutations(n,r):
    if n<r:return 0
    return math.factorial(n) // math.factorial(n - r)

n = ip()                                     #入力整数1つ
#n,k= (int(i) for i in input().split())       #入力整数横2つ以上
#a = [int(i) for i in input().split()]        #入力整数配列
# a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#k = ip()                      #入力セット(整数改行あり)(1/2)
a=[ip() for i in range(n)]    #入力セット(整数改行あり)(2/2)
#a=[input() for i in range(n)]    #入力セット(整数改行あり)(2/2)
#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
#こっから本文
a.sort()
s = 0
cnum = a[0]
csum = 1
for i in range(1,n):
    if a[i] == cnum:
        csum+=1
    else:
  #      print(csum)
        cnum = a[i]
        s+=(csum%2)
        csum=1
  #  print(s,csum)
s+=(csum%2)
print(s)

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:
from sys import exit, stdin
from collections import Counter
N = int(stdin.readline().rstrip())
A = Counter(int(stdin.readline().rstrip()) for _ in range(N))
print(len(Counter(a for a in A.elements() if A[a] % 2 == 1)))

Submission status: Accepted

Solution code:
N = int(input())
A = []
for i in range(N):
    A.append(int(input()))
As = sorted(A)
num = 0
i = 0
while i < N:
    count = 0
    j = As[i]
    while i < N and As[i] == j:
        count += 1
        i += 1
    if count % 2 == 1:
        num += 1
print(num)

Submission status: Accepted

Solution code:
import itertools

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

print(sum(sum(1 for _ in group) % 2 for key, group in itertools.groupby(sorted(a))))

Submission status: Accepted

Solution code:
N = int(input())
d = dict()
for i in range(N):
    a = int(input())
    if a in d.keys():
        d.pop(a)
    else:
        d[a] = 1

print(len(d))

Submission status: Accepted

Solution code:
from collections import Counter

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

c = list(Counter(A).items())

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

print(ans)

Submission status: Accepted

Solution code:
from collections import Counter as ct
N=int(input())
A=[int(input()) for i in range(N)]
B=ct(A)
ans=0
for b,n in B.items():
    if n%2:ans+=1
print(ans)

Submission status: Accepted

Solution code:
_,*s=open(0)
a=set()
for i in s:a^={i}
print(len(a))

Submission status: Accepted

Solution code:
_,a,*s=open(0)
a={a}
for i in s:a^={i}
print(len(a))

Submission status: Accepted

Solution code:
from collections import*
n,*a=map(int,open(0).read().split())
print(sum(v%2 for v in Counter(a).values()))

Submission status: Accepted

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

if N == 1:
    print(1)
    exit()

a.sort()
ans = 0
tmp = a[0]
a = a[1:]
count = 1
for aa in a:
    if aa == tmp:
        count += 1
    else:
        if count % 2 == 1:
            ans += 1
        tmp = aa
        count = 1
if count % 2 == 1:
            ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
S=set()
for i in range(n):
  S^=set([input()])
print(len(S))

Submission status: Accepted

Solution code:
n=int(input())
arr=[int(input()) for _ in range(n)]
arr=sorted(arr)
dic={}
for i in arr:
  if i in dic:
    dic[i]+=1
  else:
    dic[i]=1
count=0
for i in dic:
  if dic[i]%2==1:
    count+=1
print(count)

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import numpy as np
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import math

N = int(input())

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


paper = {}
for i in range(N):
    if A[i] in paper.keys():
        paper[A[i]] += 1
    else:
        paper[A[i]] = 1

cnt = 0
for key in paper.keys():
    if paper[key] %2 == 0:
        pass
    else:
        cnt += 1


print(cnt)

Submission status: Accepted

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

for i in range(n):
    s ^= {int(input())}

print(len(s))

Submission status: Accepted

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

import bisect

def main():
    n = int(input())
    s = []

    for i in range(n):
        a = int(input())
        i = bisect.bisect_left(s, a)
        if len(s) > i and s[i] == a:
            s.remove(a)
        else:
            s.insert(i, a)


    print(len(s))


main()

Submission status: Accepted

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

ans=0
cnt=1
for i in range(a-1):
  if li[i+1]==li[i]:
    if cnt==1:
      cnt=0
    else:
      cnt=1
  else:
    if cnt==1:
      ans+=1
    else:
      cnt=1

if cnt==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:
X=0
hoge=1
N=int(input())
NUM_list = list(int(input()) for i in range(N))
NUM_list.sort()
for i in range(N-1):
   if NUM_list[i]==NUM_list[i+1]:
      hoge+=1
   else:
      X += hoge%2
      hoge=1
X+=hoge%2

print(X)

Submission status: Accepted

Solution code:
N = int(input())
A = list(int(input()) for i in range(N))
A.sort()
count = 0
for i in range(N-1):
    if A[i] == A[i+1]:
        A[i] = A[i+1] = 0
for i in range(N):
    if A[i] != 0:
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

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

c = Counter(t)
ans = sum([int(x%2==1) for x in c.values()])

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
S=set()
for i in range(n):
  S^=set([input()])
print(len(S))

Submission status: Accepted

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

    memo=a[i]
print(ans)

Submission status: Accepted

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True)

N=I()
A=[I() for i in range(N)]
counts = collections.Counter(A)
ans=0
for i in counts.values():
    if i%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 not in paper:
        paper.add(A)
    else:
        paper.remove(A)

print(len(paper))

Submission status: Accepted

Solution code:
import collections

n = int(input())

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


d = [k for k, v in collections.Counter(A).items() if v%2 != 0]

print(len(d))

Submission status: Accepted

Solution code:
n = int(input())

bit = {}
for i in range(n):
    a = int(input())
    if a not in bit:
        bit[a] = 1 
    else:
        if bit[a]:
            bit[a] = 0
        else:
            bit[a] = 1
print(sum(bit.values()))

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(len(paper))

Submission status: Accepted

Solution code:
import sys
import collections
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())

n = ni()

a = [ni() for _ in range(n)]
c = collections.Counter(a).values()
ans = 0
for t in c:
    if t % 2 != 0:
        ans += 1
print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc073/tasks/abc073_c

import itertools
import collections
import bisect

def main():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    c = collections.Counter(A)

    ans = 0
    for pair in c.items():
        if pair[1] % 2 == 1:
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
d = dict()
for i in range(n):
    x = int(input())
    if d.__contains__(x):
        d[x]+=1
    else:
        d[x]=1

res = 0

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

a=Counter(A)
count=0
#for i in values
for i in a.values():
    if i%2!=0:
        count+=1
#    print(i)
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
n=int(input())
ans=0
l=[int(input()) for i in range(n)]
from collections import Counter
lst=list(Counter(l).values())
def mod2(n):
  if n%2==1:
    return 1
  else:
    return 0
ans=0
for i in lst:
  ans+=mod2(i)
print(ans)

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

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

Submission status: Accepted

Solution code:
from collections import Counter

n = int(input())
inputs = [int(input()) for _ in range(n)]
counter = Counter(inputs)

answer = 0
for number, count in counter.items():
    if count % 2 != 0:
        answer += 1

print(answer)

Submission status: Accepted

Solution code:
import collections

d = collections.defaultdict(int)

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
s = set()

for i in range(N):
    a = int(input())
    if a in s:
        s.remove(a)
    else:
        s.add(a)
print(len(s))

Submission status: Accepted

Solution code:
N = int(input())
A = list(int(input()) for _ in range(N))
A.sort()
count = 0
test = -1
stack = 0
for i in range(N):
    if test != A[i]:
        count += 1
        stack = 1
        test = A[i]
    else:
        if stack == 1:
            count = count - 1
            stack = 0
        else:
            stack = 1
            count += 1
print(count)

Submission status: Accepted

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

print(len(A))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

dic = {}

for i in range(N) :
    str = input()
    if str in dic :
        dic[str] += 1
    else :
        dic[str] = 1

cnt = 0

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

print(cnt)

Submission status: Accepted

Solution code:
n_in = int(input()) 
t = [int(input()) for i in range(n_in)] 

paper = {}
for n in t:
    if n in paper:
        del paper[n]
    else:
        paper[n] = 1
                
print(len(paper.keys()))

Submission status: Accepted

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

A.sort()

i = 0

ans = 0

while i != len(A):
	num = A[i]
	count = 0
	j = i
	while A[j] == num:
		count += 1
		j += 1
		if j == len(A):
			break

	if count % 2 == 1:
		ans += 1
	i += count
	
print(ans)

Submission status: Accepted

Solution code:
from itertools import groupby

N = int(input())

A = [None] * N

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

A = sorted(A)
B = [len([x for x in group]) for k, group in groupby(A)]
B = [b % 2 for b in B]
print(sum(B))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
ansd = {}
for i in range(N):
    a = int(input())
    if a not in ansd.keys():
        ansd[a] = 1
    else:
        ansd[a] += 1
answers = np.array(list(ansd.values()))
print(sum(answers % 2 == 1))

Submission status: Accepted

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

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

ans = 0
for val in d.values():
    if val % 2 == 1:
        ans += 1
    else:
        continue
print(ans)

Submission status: Accepted

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

memo=dict()
for a in A:
  memo[a] = not memo.get(a,False)
  
print(sum(memo.values()))

Submission status: Accepted

Solution code:
import sys
n=int(input())
a=[int(i) for i in sys.stdin]
a.sort()
stack=a[0]
num=1
ans=0
for i in range(1,n):
  if a[i]==stack:
    num+=1
  else:
    if num%2==1:
      ans+=1
    stack=a[i]
    num=1
if num%2==1:
  ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

def arraycount(arr):
    arr_target = [[]]
    cnt = 1
    for i in range(1,len(arr)):
        if arr[i] == arr[i-1]:
            cnt += 1
        else:
            arr_target.append([arr[i-1],cnt])
            cnt = 1
    arr_target.append([arr[len(arr)-1],cnt])
    del arr_target[0]
    return arr_target

a.sort()
a = arraycount(a)
ans = 0

for i in range(len(a)):
    if a[i][1] % 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 c in C:
    if C[c]%2==1:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
import collections

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

Submission status: Accepted

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

Submission status: Accepted

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