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

def myAnswer(N:int,dic:dict) -> int:
   ans = 0
   for a in dic.values():
      if(a % 2 == 1):
         ans += 1
   return ans

def modelAnswer():
   return
def main():
   N = int(input())
   dic = {}
   for _ in range(N):
      a = int(input())
      if(a in dic.keys()):
         dic[a]+=1
      else:
         dic[a]=1
   print(myAnswer(N,dic))
if __name__ == '__main__':
   main()

Submission status: Accepted

Solution code:
def myAnswer(N:int,dic:dict) -> int:
   ans = 0
   for a in dic.values():
      if(a % 2 == 1):
         ans += 1
   return ans

def modelAnswer():
   return
def main():
   N = int(input())
   dic = {}
   for _ in range(N):
      a = int(input())
      if(a in dic.keys()):
         dic[a]+=1
      else:
         dic[a]=1
   print(myAnswer(N,dic))
if __name__ == '__main__':
   main()

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))
n = ii()
s = set()
for i in range(n):
    num = ii()
    if num in s:
        s.remove(num)
    else:
        s.add(num)

print(len(s))

Submission status: Accepted

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

ans = 0
for value in key.values():
  ans += value
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    N = int(input())
    A = [int(input()) for i in range(N)]
    d = {}
    for a in A:
        if not a in d:
            d[a] = 1
        else:
            d[a] += 1
    res = 0
    for v in d.values():
        if v % 2 != 0:
            res += 1
    print(res)

if '__main__' == __name__:
    resolve()

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.readline
from collections import Counter

def main():
    N = int(readline())
    A = [int(readline()) for _ in range(N)]
    c = Counter(A)
    ans = 0
    for _, v in zip(c.keys(), c.values()):
        if v % 2 == 1:
            ans += 1
    
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc073/tasks/abc073_c
n = int(input())
nums = []
for _ in range(n):
    nums.append(int(input()))

s = set()
for num in nums:
    if num in s:
        s.remove(num)
    else:
        s.add(num)
ans = len(s)
print(ans)

Submission status: Accepted

Solution code:
def ABC073C(d,i):
    if i in d:
        d[i]= not(d[i])
    else:
        d[i]=True
    return d

n,*a=map(int,open(0).read().split())
d=dict()
for i in a:
    d = ABC073C(d,i)
print(sum(d.values()))

Submission status: Accepted

Solution code:
def ABC073C(d,i):
    if i in d:
        d[i]= not(d[i])
    else:
        d[i]=True
    return d

n=int(input())
d=dict()
for i in range(n):
    d = ABC073C(d,int(input()))
print(sum(d.values()))

Submission status: Accepted

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

pre = sorted_A[0]
ans = 0
if len(sorted_A) == 1:
    print(1)
else:
    count = 1
    for i in range(1, len(sorted_A)):
        if sorted_A[i] == pre:
            count += 1
            if i == len(sorted_A)-1:
                if count % 2 == 1:
                    ans += 1
        else:
            if i == len(sorted_A)-1:
                ans += 1
            if count % 2 == 1:
                ans += 1
            pre = sorted_A[i]
            count = 1
    print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math
import functools

n = int(input())
a = [int(input()) for i in range(n)]
c = collections.Counter(a)
ans = []
for key,value in c.items():
    ans.append([key,value])
cnt = 0
for i in range(len(ans)):
    if ans[i][1]%2 == 1:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import collections

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

Adic = collections.Counter(A)

B = [n % 2 for n in Adic.values() if n % 2 != 0]

print(len(B))

Submission status: Accepted

Solution code:
import collections

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

Adic = collections.Counter(A)

B = [n % 2 for n in Adic.values()]

print(B.count(1))

Submission status: Accepted

Solution code:
from collections import defaultdict

n = int(input())
data = defaultdict(int)

for i in range(n):
    a = int(input())
    data[a] += 1

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = set()
for _ 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())
d = {}
a = []
for _ in range(N):
    A = int(input())
    a.append(A)
    if not(A in d):
        d[A] = 1
        continue
    elif d[A]==1:
        d[A] = 0
    else:
        d[A] = 1

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

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)]

COUNTS = Counter(A)

print(sum(count % 2 for count in COUNTS.values()))

Submission status: Accepted

Solution code:
# solution
import io

data = int(input())

array = set()
for _ in range(data):
    ai = int(input())
    if ai in array:
        array.remove(ai)
    else:
        array.add(ai)
print(len(array))

Submission status: Accepted

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

dic=dict(Counter(a))
ans=0
for i,k in dic.items():
    if k%2==1:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
#from collections import defaultdict
#d = defaultdict(int)
#import fractions
#import math
#import collections
#from collections import deque
#from bisect import bisect_left
#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [input() for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
N = int(input())
d = {}
s = 0
for i in range(N):
    a = int(input())
    if a in d.keys():
        d[a] += 1
    else:
        d[a] = 1
for i in d.values():
    s += i%2
print(s)

Submission status: Accepted

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

S=Counter(L)
count=0
for i,j in S.items():
	if j%2==1:
		count+=1
print(count)

Submission status: Accepted

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

import collections

tc = collections.Counter(t)
tci = list(tc.items())

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

Submission status: Accepted

Solution code:
N = int(input())

d = {}
ans = 0

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

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

print(ans)

Submission status: Accepted

Solution code:
import sys
import os
import math

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    ret = set()
    for n in range(N):
        i = [ii()]
        ret ^= set(i)
    print(len(ret))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input());A=[]
for i in range(n):
    A.append(int(input()))
A.sort()
i = 1
count = 0
odd = 1
value = A[0]
while i < n:
    if value != A[i]:
        count += odd%2
        odd = 1
        value = A[i]
    else:
        odd += 1
    i += 1
count+= odd%2
print(count)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for _ in range(n)]
count = {}
for i in a:
    if i in count.keys() and count[i]==1:
        count[i] -= 1
    else:
        count[i] = 1
print(sum(count.values()))

Submission status: Accepted

Solution code:
import collections

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

c = collections.Counter(a)

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

N,*An=map(int, open(0).read().split())

count=Counter(An)
print(len(list(filter(lambda v:v%2==1, count.values()))))

Submission status: Accepted

Solution code:
from collections import defaultdict

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

print(len(list(filter(lambda v:v%2==1, An.values()))))

Submission status: Accepted

Solution code:
n = int(input())
a = sorted([int(input()) for _ in range(n)])
l = 0
r = 0
c = 0
for i in range(1, n):
    if a[l] != a[i]:
        r = i - 1
        if (r - l + 1) & 1:
            c += 1
        l = i
r = n - 1
if (r - l + 1) & 1:
    c += 1
print(c)

Submission status: Accepted

Solution code:
n=int(input())
from collections import defaultdict
a=defaultdict(int)
for i in range(n):
  a[int(input())]^=1
print(sum(a.values()))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

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

A.sort()

current_number = A[0]
current_count = 1
ans = 0

for i in range(1,N-1):
    if current_number == A[i]:
        current_count += 1
    else:
        current_number = A[i]
        if current_count % 2 != 0:
            ans += 1
        current_count = 1

if current_number == A[N-1]:
    current_count += 1
    if current_count % 2 != 0:
            ans += 1
else:
    if current_count % 2 != 0:
            ans += 1
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

paper = set()
for a in A:
    if a in paper:
        paper.remove(a)
    else:
        paper.add(a)

print(len(paper))

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input())for i in range(n)]
cnt = {}
for x in a:
    cnt[x] = 0
for x in a:
    if cnt[x] == 0:cnt[x]+=1
    else:cnt[x] -=1
ans = 0
for key in cnt:
    ans += cnt[key] >0
print(ans)

Submission status: Accepted

Solution code:
import collections

N = int(input())

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

A.sort()
cnt = collections.Counter(A)

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

print(ans)

Submission status: Accepted

Solution code:
import sys
from collections import Counter

n, *a = map(int, sys.stdin.read().split())

def main():
    res = 0
    for v in Counter(a).values():
        res += v & 1
    print(res)

if __name__ ==  '__main__':
    main()

Submission status: Accepted

Solution code:
import collections
n=int(input())
s=[int(input()) for i in range(n)]
p=collections.Counter(s)
c=0
for x in p.values():
    if x%2==1:c+=1
print(c)

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())
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:
#ソートして左から数えるver
N = int(input())
a = sorted([int(input()) for i in range(N)])

count_list = [1]*len(set(a))
j = 0

for i in range(len(a)-1):
	if a[i] == a[i+1]:
		count_list[j] += 1
	else:
		j += 1

print(sum([ i%2 == 1  for i in count_list]))

Submission status: Accepted

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

a.sort()
a.append(0)
ans = 0
flag = True
for i in range(1,n+1):
    if a[i] == a[i-1]:
        flag = not flag
    else:
        if flag:
            ans += 1
        flag = True
    #print(flag)
    #print(a[i])
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def main():
    N = int(input())
    d = {}
    for _ in range(N):
        a = int(input())
        if a not in d:
            d[a] = 1
        else:
            if d[a] == 1:
                d[a] = 0
            else:
                d[a] = 1
    
    cnt = 0
    for v in d.values():
        if v == 1:
            cnt += 1
    print(cnt)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#
# Written by NoKnowledgeGG @YlePhan
# ('ω')
#
#import math
#mod = 10**9+7
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""

""" n! mod m 階乗
mod = 1e9 + 7
N = 10000000
fac = [0] * N
def ini():
  fac[0] = 1 % mod
  for i in range(1,N):
    fac[i] = fac[i-1] * i % mod"""

"""mod = 1e9+7
N = 10000000
pw = [0] * N
def ini(c):
  pw[0] = 1 % mod
  for i in range(1,N):
    pw[i] = pw[i-1] * c % mod"""

"""
def YEILD():
  yield 'one'
  yield 'two'
  yield 'three'
generator = YEILD()
print(next(generator))
print(next(generator))
print(next(generator))
"""
"""def gcd_(a,b):
  if b == 0:#結局はc,0の最大公約数はcなのに
    return a
  return gcd_(a,a % b) # a = p * b + q"""
"""def extgcd(a,b,x,y):
  d = a
  if b!=0:
    d = extgcd(b,a%b,y,x)
    y -= (a//b) * x
    print(x,y)
  else:
    x = 1
    y = 0
  return d"""
# 最大公約数 と 最小公倍数
"""def gcd(a,b):
  if b == 0:
    return a
  return gcd(b, a % b)
def lcm(a,b):
  g = gcd(a,b)
  return (a * b) // g"""

def readInts():
  return list(map(int,input().split()))
mod = 10**9 + 7

def main():
  n = int(input())
  dic = {}
  for i in range(n):
    a = int(input())
    if a in dic:
      if dic[a] == 1:
        dic[a] = 0
      elif dic[a] == 0:
        dic[a] = 1
    else:
      dic[a] = 1
  cnt = 0
  for k,v in dic.items():
    cnt += v
  print(cnt)
if __name__ == '__main__':
  main()

Submission status: Accepted

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

ans = 0
for kk in d.keys():
    if d[kk] == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:

url = "https://atcoder.jp//contests/abc073/tasks/abc073_c"

def main():
    li = {}
    n = int(input())
    for i in range(n):
        ind = int(input())
        li.setdefault(ind, 0)
        if li[ind] == 0:
            li[ind] = 1
        else:
            li[ind] = 0
    print(list(li.values()).count(1))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter
n, *A = map(int, open(0).read().split())
ans = 0
for v in  Counter(A).values():
  if v % 2 == 1:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
num_dic = {}
cnt = 0
for i in range(N):
    A = int(input())
    if A in num_dic:
        del num_dic[A]
        cnt -= 1
    else:
        num_dic[A] = 1
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
#from operator import itemgetter
from collections import Counter
N = int(input())
#N, M = map(int, input().split())
A = [int(input()) for i in range(N)]

answer = 0
C = Counter(A)
C_taple = C.most_common()

for i in C_taple:
    if i[1]%2!=0:
        answer += 1

print(answer)

Submission status: Accepted

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

aa = collections.Counter(a)
ans = 0
for i in aa:
    if aa[i] % 2 == 1:
        ans += 1
    
print(ans)

Submission status: Accepted

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

from collections import defaultdict
d=defaultdict(int)
for a in A:
    d[a]+=1
ans=0
for k in d.keys():
    if d[k]%2==1:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
n,*a=map(int,open(0).read().split())
s=set()
for i in a:
  s^={i}
print(len(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
d = {}
for i in range(n):
  a = int(input())
  if a in d:
    if d[a] <= 0:
      d[a] += 1
    else:
      d[a] -=1
  else:
    d[a] = 1
cnt = 0
for i in d.values():
  if i > 0:
    cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Problem C - Write and Erase

from collections import Counter

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

# initialization
a_counter = Counter(a_list)
ans_count = 0

# count
for count_key in a_counter:
    if a_counter[count_key]%2==1:
        ans_count += 1

# output
print(ans_count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

ans = {}
for _ in range(N):
    a = input()
    if a in ans:
        del ans[a]
    else:
        ans[a] = 1

print(len(ans))

Submission status: Accepted

Solution code:
from collections import Counter

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

print(len([i for i in c if i % 2 == 1]))

Submission status: Accepted

Solution code:
import collections
co = collections.Counter()
n = int(input())
for i in range(n):
    a = int(input())
    if co[a] ==1:
        co[a]-=1
    else:co[a] +=1
ans = 0
for num,cnt in co.items():
    ans +=cnt
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter, deque # https://note.nkmk.me/python-scipy-connected-components/
# from copy import copy, deepcopy
# from fractions import gcd
# from functools import reduce
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np  # Pythonのみ！
# from operator import xor
# import re
# from scipy.sparse.csgraph import connected_components  # Pythonのみ！
# ↑cf.  https://note.nkmk.me/python-scipy-connected-components/
# from scipy.sparse import csr_matrix
# import string
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    N=int(input())
    A=[int(input()) for i in range(N)]
    AA=Counter(A)

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



resolve()

Submission status: Accepted

Solution code:
from collections import defaultdict

n = int(input())
d = defaultdict(int)

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

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

print(ans)

Submission status: Accepted

Solution code:
from collections import Counter

n = int(input())
A = list(int(input()) for _ in range(n))
D = Counter(A)

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

Submission status: Accepted

Solution code:
import sys
def main():
    input = sys.stdin.readline
    N=int(input())
    A=[int(input()) for _ in range(N)]
    from collections import Counter
    C=Counter(A)
    ans=0
    for v in C.values():
        if v&1: ans+=1
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

cnt = {}
for Ai in A:
    key = str(Ai)
    cnt[key] = cnt.setdefault(key, 0) + 1

ans = sum([cnt[key] % 2 for key in cnt.keys()])
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)

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

ans = sum(v % 2 for v in c.values())
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:
def main():
    N = int(input())
    A = [int(input()) for i in range(N)]
    from collections import Counter
    c = Counter(A)
    ans = 0
    for v in c.values():
        if v % 2:
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
l = [int(input()) for i_ in range(n)]
c = Counter(l)
cnt = 0
for i in c.values():
    cnt+=i%2

print(cnt)

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]
debugmode = False

n = INT()
arr = []
for i in range(n):
    arr.append(INT())
b = Counter(arr)
c = list(set(arr))
ans = []
for i in c:
    if b[i] % 2:
        ans.append(i)
print(len(ans))

Submission status: Accepted

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

Submission status: Accepted

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

for a in A:
    if a in st:
        st.remove(a)
    else:
        st.add(a)
print(len(st))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

d = {}
for ai in a:
  if ai in d:
    d[ai] += 1
  else:
    d[ai] = 1
ans = 0
for v in d.values():
  if v%2 == 1:
    ans += 1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

A.sort()

odd = 0
count = 1
a = A[0]
for i in A[1:]:
  if i == a:
    count += 1
  else:
    a = i
    if count % 2 == 1:
      odd += 1
    count = 1
if count % 2 == 1:
      odd += 1
print(odd)

Submission status: Accepted

Solution code:
N = int(input())

A = {}

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

print(len(A))

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
s = [0]*n
for i in range(n):
  s[i] = input()
dum = Counter(s)
s_most = dum.most_common()
s_len = len(s_most)
ans = 0
for i in range(s_len):
  if s_most[i][1]%2 != 0:
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    from collections import Counter
    import sys

    input = sys.stdin.readline

    N = int(input())  # <= 10**5
    a = [int(input()) for _ in range(N)]
    ctr = Counter(a)

    ans = 0
    for cnt in ctr.values():
        ans += cnt % 2
    print(ans)


if __name__ == '__main__':
    main()

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
  import collections
  import sys
  input = sys.stdin.readline
  n = int(input())
  b = []
  for i in range(n):
    a = int(input())
    b_append = b.append
    b_append(a)

  s = set(b)
  s = tuple(s)
  c = collections.Counter(b)
  ans = 0
  for i in range(len(s)):
    if c[s[i]] % 2 == 0:
      continue
    else:
      ans += 1
  print(ans)
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.buffer.readline().split()]
def I(): return int(sys.stdin.buffer.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n = I()
    a = IR(n)
    s = defaultdict(lambda : 0)
    for i in a:
        s[i] ^= 1
    print(sum(s.values()))
    return

#Solve
if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
import collections

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

M = collections.Counter(L)
C = M.most_common()
cnt = 0

for x in C:
    if x[1] % 2 == 1:
        cnt += 1
        
print(cnt)

Submission status: Accepted

Solution code:
import sys
from collections import Counter

read = sys.stdin.read
n, *A = map(int, read().split())

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