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().rstrip())
nums = [int(input().rstrip()) for _ in range(n)]

num_hash={}
for n in nums:
    if num_hash.get(n):
        num_hash[n] += 1
    else:
        num_hash[n] = 1

num_counter = 0
for k in num_hash.keys():
    if num_hash[k] %2 == 1:
        num_counter += 1
print(num_counter)

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from collections import Counter

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

counter = Counter(memo)

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

print(ans)

Submission status: Accepted

Solution code:
from collections import Counter

N = int(input())
c = Counter(int(input()) for _ in range(N))
print(len(list(filter(lambda x: x % 2 == 1, c.values()))))

Submission status: Accepted

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

import sys
# import time
# import math
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)



def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79...e+308
    # inf = 2 ** 64 - 1             # (for fast JIT compile in PyPy) 1.84...e+19
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    n = ii()
    memo = set()
    for _ in range(n):
        x = ii()
        if x in memo:
            memo.remove(x)
        else:
            memo.add(x)
    
    print(len(list(memo)))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#dpでできないかな？
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7
n=I()
lis=[I() for i in range(n)]
c=Counter(lis)
count=0
for i in c.keys():
    if c[i]%2==1:
        count+=1
print(count)

Submission status: Accepted

Solution code:
import itertools

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

count = 0
itrs = itertools.groupby(A)
for k, v in itrs:
    if len(list(v)) % 2 == 1:
        count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

dic = {}
for i in range(n):
    tmp = int(input())
    if tmp not in dic:
        dic[tmp] = 1
    elif dic[tmp] == 1:
        dic[tmp] = 0
    else:
        dic[tmp] = 1

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

print(ans)

Submission status: Accepted

Solution code:
from collections import Counter


def main():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    c = Counter(A)
    print(sum([v % 2 for v in c.values()]))


if __name__ == '__main__':
    main()

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for i in range(n)]
dict = {}
count = 0
for i in a:
  if i not in dict:
    dict[i] = 1
  elif i in dict:
    dict[i]+= 1

for i in set(a):
  if dict[i]%2!=0:
    count += 1
    
    
print(count)

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:
n=int(input())
A=set()
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:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()

from collections import defaultdict, deque, Counter
from sys import exit
import heapq
import math
import fractions
import copy
from itertools import permutations
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

N = getN()
A = Counter(getArray(N))
cnt = 0
for i in A.values():
    if i % 2 == 1:
        cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8

# In[17]:


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


# In[18]:


import collections


# In[19]:


count = collections.Counter(A)
ans = 0
for d in count.values():
    if d%2 != 0:
        ans += 1
print(ans)


# In[ ]:

Submission status: Accepted

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

import collections
c = collections.Counter(A)

A = sorted(set(A))

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

Submission status: Accepted

Solution code:
N = int(input())

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

arr.sort()
cnt = 0
num = 1

a = arr[0]

for i in range(1,N):
  if arr[i] == a:
    num += 1
  else:
    if num % 2 == 1:
      cnt += 1
    num = 1
    a = arr[i]
if num % 2 == 1:
  cnt += 1

print(int(cnt))

Submission status: Accepted

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

result = set([])
for i in A:
    if i in result:
        result.remove(i)
    else:
        result.add(i)
print(len(result))

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = [INT() for _ in range(N)]	

dic = defaultdict(int)

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

#print(dic)
print(sum([dic[x] for x in dic]))

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = [INT() for _ in range(N)]	

dic = defaultdict(int)

for a in A:
	dic[a] += 1

#print(dic)
print(len([1 for x in dic if dic[x]%2]))

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = [INT() for _ in range(N)]	

dic = defaultdict(int)

for a in A:
	dic[a] += 1

#print(dic)
print(len([1 for x in dic if dic[x]%2 == 1]))

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = [INT() for _ in range(N)]	

dic = dict()

for a in A:
	if a in dic:
		dic[a] ^= 1
	else:
		dic[a] = 1

#print(dic)
ans = 0
for x in dic:
	ans += dic[x]
print(ans)

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = [INT() for _ in range(N)]	

dic = defaultdict(int)

for a in A:
	#print(dic[a])
	dic[a] ^= 1

#print(dic)
ans = 0
for x in dic:
	ans += dic[x]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
nums = {}
for _ in range(N):
    num = int(input())
    if num in nums:
        nums.pop(num)
    else:
        nums[num] = 0

print(len(nums))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()

num = defaultdict(int)

for _ in range(N):
	A = INT()
	num[A-1] ^= 1

ans = 0
for x in num:
	ans += num[x]

print(ans)

Submission status: Accepted

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####GCD#####
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n = n//a
    count += 1
  if a**count == n:
    return count
  else:
    return count+1

#############
# Main Code #
#############

N = I()
A = ILs(N)
d = DD(int)
for a in A:
  d[a] += 1
  
d = [(d[k])for k in d]

P(sum(1 if k%2 else 0for k in d))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    l=[input() for i in range(n)]
    cnt=0
    from collections import Counter
    c=Counter(l)# ()にカウンターの対象のリストの変数名
    for i in c.values():
        if i%2==1:
            cnt+=1
    print(cnt)
resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

res = 0
#print(Counter(A))

c = Counter(A)
for i in c.values():
    res += i % 2
print(res)

Submission status: Accepted

Solution code:
import collections

N = int(input())

l = list()
for i in range(N):
    l.append(int(input()))

c = collections.Counter(l)

la = list(c.values())
M = len(la)
ans = 0
for i in range(M):
    if la[i] % 2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
from collections import *
N,*A=map(int,open(0).read().split())
print(sum([i&1 for i in Counter(A).values()]))

Submission status: Accepted

Solution code:
def resolve():
    # 整数 1 つ
    n = int(input())
    # 整数複数個
    # a, b = map(int, input().split())
    # 整数 N 個 (改行区切り)
    A = [int(input()) for i in range(n)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    A = sorted(A)
    Dic = {a:0 for a in set(A)}

    for x in A:
        Dic[x] += 1

    cnt = 0
    for y in Dic:
        if Dic[y] % 2 == 1:
            cnt += 1

    print(cnt)


resolve()

Submission status: Accepted

Solution code:
# coding: utf-8
import re
import math
from collections import defaultdict
from collections import deque
import collections
from fractions import Fraction
import itertools
from copy import deepcopy
import random
import time
import os
import queue
import sys
import datetime
from functools import lru_cache
#@lru_cache(maxsize=None)
readline=sys.stdin.readline
sys.setrecursionlimit(2000000)
#import numpy as np
alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(n)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def ispow(a,b):#aはbの累乗数か
    now=b
    while now<a:
        now*=b
    if now==a:return True
    else:return False
def getbin(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def getfacs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod_>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def nextcomb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:return num
def getprimes(n,type="int"):
    if n==0:
        if type=="int":return []
        else:return [False]
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def isprime(num):
    if(num<=1):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(a,b,c):
    if a:return b
    else:return  c
def join(A,c=""):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
def factorize(n,type_="dict"):
    b = 2
    list_ = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            list_.append(b)
        b+=1
    if n > 1:list_.append(n)
    if type_=="dict":
        dic={}
        for a in list_:
            if a in dic:
                dic[a]+=1
            else:
                dic[a]=1
        return dic
    elif type_=="list":
        return list_
    else:
        return None
def pm(x):
    return x//abs(x)
def inputintlist():
    return list(map(int,input().split()))
######################################################################################################

n=int(input())
A=[0]*n
for a in range(n):
    A[a]=int(input())
C=collections.Counter(A)
ans=set()
for a,b in C.items():
    if b%2==1:
        ans.add(a)
print(len(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

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

ans=0
for key,count in a.most_common():
    if count%2==1:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter

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

c = Counter(a)

ans = 0
for key, value in c.most_common():
    if value % 2 != 0:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import collections

readline = sys.stdin.readline

def main():
    N = int(readline())
    A = []
    for _ in range(N):
        A.append(int(readline()))
    Aitems = list(zip(*collections.Counter(A).items()))
    Acount = list(Aitems[1])
    tmp = [x%2 for x in Acount]
    ans = sum(tmp)
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

a.sort()

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

            

if cnt%2:
    print(res+1)
else:
    print(res)

Submission status: Accepted

Solution code:
N = int(input())

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

print(len(S))

Submission status: Accepted

Solution code:
N = int(input())
memo = {}
for _ in range(N):
    Ai = int(input())
    try:
        memo[Ai] += 1
    except:
        memo[Ai] = 1

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
AB = [int(input()) for _ in range(N)]
CAB = Counter(AB)
ans = 0

for i,j in CAB.items():
  if j%2 != 0:
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
import collections

n = int(input())
li = [int(input()) for i in range(n)]
c = collections.Counter(li)
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict


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

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

ans = 0
for value in list(dict.values()):
    if value % 2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
import collections,sys
def I(): return int(sys.stdin.readline().rstrip())
N = I()
A = [I() for _ in range(N)]
count_A = collections.Counter(A)
print(sum([1 for v in count_A.values() if v%2==1]))

Submission status: Accepted

Solution code:
from collections import defaultdict

N = int(input())
memo = defaultdict(int)

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

ans = list(memo.values())
ans = [x for x in ans if x % 2 == 1]

print(len(ans))

Submission status: Accepted

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

cnt = set([])
for i in a:
    if i in cnt:
        cnt.discard(i)
    else:
        cnt.add(i)
print(len(cnt))

Submission status: Accepted

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