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:
#!/usr/bin/env python3
# sys.stdin.readline()
import numpy as np
import math
import sys
from collections import defaultdict
input = sys.stdin.readline
n = int(input())
d = defaultdict(int)

for i in range(n):
    k = int(input())
    if d[k] ==1:
        d[k] -=1
    else:
        d[k] +=1
print(sum(d.values()))

Submission status: Accepted

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

total = {}
for i in a:
  if i in total:
    total[i] += 1
  else:
    total[i] = 1

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
A=dict()
for i in range(N):
	tmp=int(input())
	if not tmp in A:
		A[tmp]=1
	elif A[tmp]==1:
		A[tmp]=0
	else:
		A[tmp]=1
print(sum(A.values()))

Submission status: Accepted

Solution code:
n = int(input())
a = [0]*n
for i in range(n):
    a[i] = int(input())
import collections
c = collections.Counter(a)
L = set(a)
b = list(L)
count = 0
for i in range(len(b)):
    if c[b[i]]%2 == 1:
        count += 1
print(count)

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
N = int(readline())

NUMBERS = defaultdict(bool)

for _ in range(N):
  n = int(readline())
  NUMBERS[n] = not NUMBERS[n]

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())

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

dic={}

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

ans=0

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
num_dict = {}
for i in range(n):
    tmp = input()
    num_dict.setdefault(tmp ,1)
    num_dict[tmp] += 1
    
cnt = 0
for i in num_dict.values():
    if i % 2 == 0:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import collections

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

CTR_num = collections.Counter(num_list)
summ = 0

for i in CTR_num.keys():
    n = CTR_num[i]
    
    if (n % 2 != 0):
        summ += 1

print(summ)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    n=int(readline())
    a=[int(readline()) for _ in range(n)]

    s=set()
    for i in range(n):
        if a[i] in s:
            s.remove(a[i])
        else:
            s.add(a[i])

    print(len(s))
    
if __name__=="__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from collections import Counter

n = int(readline())
a = [int(readline()) for _ in range(n)]
ans = 0
for v in Counter(a).values():
    ans += 1 if v % 2 == 1 else 0
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter

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

print(len([0 for count in counter.values() if count % 2 == 1]))

Submission status: Accepted

Solution code:
import collections
N =int(input())
A = [int(input()) for _ in range(N)]
A_col = collections.Counter(A)
ans = 0
#valueが奇数なら追加
for v in A_col.values():
    if v % 2 == 1:
      ans += 1
print(ans)

Submission status: Accepted

Solution code:
import math
import queue
from collections import defaultdict

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def printQueue(q):
	r=qb
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
def dq():
	return queue.deque()
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1

n = readInt()
d = defaultdict(int)
for i in range(n):
	d[readInt()]+=1
ans = 0
for i in d.values():
	if i%2==1:
		ans+=1
print(ans)

Submission status: Accepted

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

for i in range(N):
    a = input()
    try:
        inputSet.remove(a)
    except KeyError:
        inputSet.add(a)

print (len(inputSet))

Submission status: Accepted

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

count = 0
for i, v in c.items():
    if (v % 2 == 0):
        continue
    else:
        count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict

n = int(input())
cnt = defaultdict(int)

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

ret = 0
for c in cnt.values():
  
  if c % 2 == 1:
    ret += 1

print(ret)

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:
import collections
N = int(input())
A = [int(input()) for i in range(N)]
c = collections.Counter(A)
num = 0
for i,j in c.items():
  if j%2 != 0:
    num += 1
print(num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

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

c = Counter(A)

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

print(ans)

Submission status: Accepted

Solution code:
import sys
import re
import math
import collections
import decimal
import bisect
import itertools
import fractions

import copy

# import heapq
# from collections import deque
# import decimal

sys.setrecursionlimit(10000001)
INF = sys.maxsize
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===

def main():
    n = ni()
    a = set()

    for _ in range(n):
        ai = ni()
        if ai not in a:
            a.add(ai)
        else:
            a.remove(ai)

    print(len(a))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

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

c = Counter(A)

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

print(ans)

Submission status: Accepted

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

a_count = Counter(a_input)
print(sum(v%2!=0 for v in a_count.values()))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections

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

c = collections.Counter(x)

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

print(ct)

Submission status: Accepted

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

from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement

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

c = Counter(A)

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

print(ct)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import collections
N = int(input())
A = [int(input()) for _ in range(N)]

C = collections.Counter(A)

ans = 0
for n, t in C.items():
    if t%2 != 0: ans+=1
print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
from collections import Counter


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N = int(_in[0])  # type:int
    A_arr = []
    for i in range(N):
        _ = int(_in[i+1])  # type:int
        A_arr.append(_)
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    cnt = 0
    count = Counter(A_arr).values()
    count_odd = [_ for _ in count if _%2==1]
    cnt = len(count_odd)
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(cnt)

Submission status: Accepted

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

c = collections.Counter(A)
cnt = 0
for key, value in c.items():
    if value % 2 == 1:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import collections
n = int(input())
a = []
ans = 0
for _ in range(n):
    a.append(int(input()))
acnt = collections.Counter(a)
for cnt in acnt.values():
    if cnt%2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter


n = int(input())
m = [int(input()) for _ in range(n)]
s = Counter(m)
print(sum(1 if i % 2 != 0 else 0 for i in s.values()))

Submission status: Accepted

Solution code:
N = int(input())
A = [int(input()) for _ in range(N)]
B = {}
for i in A:
    if i not in B:
        B[i] = 1
    else:
        if B[i] == 1:
            B[i] -= 1
        else:
            B[i] += 1
cnt = 0
for j in B.keys():
    if B[j] == 1:
        cnt += 1
print(cnt)

Submission status: Accepted

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

for i in range(n):
    s = str(input().split())
    if s not in candidate.keys():
        candidate[s] = 1
    else:
        candidate[s] += 1

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

print(ans)

Submission status: Accepted

Solution code:
import sys
from collections import Counter

N = int(sys.stdin.readline())

A = []
for _ in range(N):
    a = int(sys.stdin.readline())
    A.append(a)

counter = Counter(A)
ans = 0
for key, count in counter.items():
    if count % 2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:


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


d = {}
for i in a:
    if i not in d:
        d[i] = 0
        d[i] +=1
    elif i in d:
        if d[i] == 0:
            d[i] +=1
        else:
            d[i] -=1
        
        
l =[]
for i in d.keys():
    if d[i] != 0:
        l.append(d[i])
print(len(l))

Submission status: Accepted

Solution code:
from collections import Counter

N = int(input())
a = []
for _ in range(N):
    a.append(int(input()))
    
a = Counter(a)
ans = 0
for value in a.values():
    if value % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from collections import defaultdict
n = int(input())
paper = defaultdict(lambda : 0)
for _ in range(n):
    a = int(input())
    if paper[a] == 0:
        paper[a] = 1
    else:
        paper[a] =0
total = 0
for i in paper.values():
    if i > 0:
        total += 1
print(total)

Submission status: Accepted

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

for _ in range(N):
    n = int(input())
    d[n] += 1
    if d[n] % 2 == 0:
        ans -= 1
    else:
        ans += 1

print(ans)

Submission status: Accepted

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

count = collections.Counter(a)
num =list(count.values())
ans = 0

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

print(ans)

Submission status: Accepted

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

paper = set()

for elem in a:
    if elem in paper:
        paper.discard(elem)
    else:
        paper.add(elem)

print(len(paper))

Submission status: Accepted

Solution code:
from collections import defaultdict

n = int(input())
a = [int(input()) for _ in range(n)]
h = defaultdict(int)
for x in a:
    h[x] += 1
ans = 0
for k in h:
    if h[k] % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = [input() for i in range(N)]
dic={}
for a in A:
  if a not in dic:
    dic[a] = 1
  elif dic[a] != 1:
    dic[a] = 1
  else:
    dic[a] = 0
print(list(dic.values()).count(1))

Submission status: Accepted

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

dic={}
for i in li:
    if i not in dic:
        dic[i] = 1
    elif dic[i] != 1:
        dic[i] = 1
    else:
        dic [i] = 0
        
cnt = 0     
for i in dic:
    if dic[i] == 1:
        cnt += 1
print(cnt)

Submission status: Accepted

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

N = int(input())
# S = input()
# N, K = map(int, input().split())
# A = list(map(int, input().split()))
from collections import Counter

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    n = int(stdin.readline())
    a = [int(stdin.readline()) for _ in range(n)]
    l = {}
    for ai in a:
        if ai not in l:
            l[ai] = 1
        else:
            l[ai] = l[ai] + 1
    ans = 0
    for key in l:
        if l[key] % 2 == 1:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
	d = {}
	n = int(input())
	for _ in range(n):
		a = int(input())
		if d.get(a):
			del d[a]
		else:
			d[a] = True
	print(len(d.keys()))
resolve()

Submission status: Accepted

Solution code:
n=int(input())
a=[int(input()) for i in range(n)]
d={}
for i in range(n):
  if a[i] in d:
    d[a[i]]+=1
  else:
    d[a[i]]=1
cnt=0
d=list(d.items())
for i in range(len(d)):
  if d[i][1]%2==1:
    cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
import sys
import os
import math
import bisect
import collections
import itertools

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

lcm = lambda x, y: x * y / math.gcd(x, y)

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


def f(A, B, x):
    return math.floor(A * x / B) - A * math.floor(x / B)


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

    N = ii()
    A = collections.Counter(ii() for _ in range(N))

    print(sum(1 for v in A.values() if v % 2 != 0))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
a = [int(input()) for _ in range(n)]
d = dict(Counter(a))
cnt = 0
for v in d.values():
    if v%2!=0:
        cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
from collections import Counter
def main():
    n = int(input())
    l1 = []
    for _ in range(n):
        l1.append(input())
    l1c = Counter(l1)
    l1c2 = [c for c in l1c if l1c[c]%2 != 0]
    print(len(l1c2))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    N = int(input())
    d = defaultdict(int)
    for _ in range(N):
        d[int(input())] += 1
    ans = 0
    for i in d.values():
        if i%2==1:
            ans +=1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())

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

Submission status: Accepted

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

import collections
c = collections.Counter(A)
ans = 0
for key in c.keys():
    if c[key]%2 == 1:
        ans +=1
print(ans)

Submission status: Accepted

Solution code:
import collections

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

Submission status: Accepted

Solution code:
N = int(input())
dic = {}
for i in range(N):
    a = input()
    if a not in dic or dic[a] == 0:
        dic[a] = 1
    elif dic[a] == 1:
        dic[a] = 0
cnt = 0
for key,vol in dic.items():
    if vol == 1:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
l = []
for i in range(n):
  l.append(int(input()))
c = Counter(l)
ans = 0
for i in list(c.values()):
  if i % 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_counter = collections.Counter(A)

ans = 0
for a in A_counter.items():
    
    if a[1] % 2 != 0:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
import sys

def input():
    return sys.stdin.readline().strip()

def main():
    N = int(input())
    A = [input() for _ in range(N)]
    common = Counter(A).most_common()
    ans = 0
    for i in common:
        if i[1] % 2 == 1:
            ans += 1
    print(ans)
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
A = {}

n = int(input())

for _ in range(n):
    a = int(input())
    A[a] = not A.setdefault(a, False)

print(sum(A.values()))

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def resolve():
    '''
    code here
    '''
    import collections

    N = int(input())
    A_list = [int(input()) for _ in range(N)]
    cnt_dic = collections.Counter(A_list)

    cnt = 0
    for v in cnt_dic.values():
        if v % 2 == 1:
            cnt += 1

    print(cnt)

if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
import collections
def slove(n, xs):

    count = collections.Counter()

    for i in xs:
        count[i] += 1

    ans = len([value for value in count.values() if value % 2 == 1])
    return ans

if __name__ == "__main__":
    n = int(input())
    xs = [int(input()) for i in range(n)]
    print(slove(n, xs))

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = [int(input()) for a in range(N)]
    S = set()

    for i in range(N):
        if A[i] in S:
            S.remove(A[i])
        else:
            S.add(A[i])
    print(len(S))
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(N):
    a = int(input())
    if a in A:
        A[a] ^= 1
    else:
        A[a] = 1

print(sum(A.values()))

Submission status: Accepted

Solution code:
from collections import defaultdict

N = int(input())
dict = defaultdict(int)
ans = 0

for i in range(N):
    dict[input()] += 1

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

Submission status: Accepted

Solution code:
n = int(input())

dic = {}

for i in range(n):
    a = int(input())
    if dic.get(a) is None:
        dic[a] = 1
    else:
        dic[a] = (dic[a] + 1)%2
        
    
val = list(dic.values())
ans = int(sum(val))

print(ans)

Submission status: Accepted

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

import collections
C = collections.Counter(A)
ans = 0
for a in C.values():
    if a % 2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

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

c = Counter(a_ls)
ans = 0
for value, count in c.items():
    if count % 2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

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

l_set=list(set(l))
counter=collections.Counter(l)
ans=0
for i in range(len(l_set)):
    if counter[l_set[i]]%2!=0:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = []
for i in range(n):
    s = int(input())
    a.append(s)
a.sort()
i = 0
cnt = 0
while i < n:
    j = i+1
    chk = 1
    if j >= n:
        cnt += 1 
        break
    while a[i] == a[j]:
        chk += 1
        j += 1
        if j >= n:
            break
    if chk%2 == 1:
        cnt += 1 
    i = j
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
l = [0] * 100010

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

Submission status: Accepted

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

Submission status: Accepted

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

    c = collections.Counter(a)

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

    return ans

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

Submission status: Accepted

Solution code:
import collections

def main():
    N = int(input())
    S = []
    for _ in range(N):
        S.append(input())
    c = collections.Counter(S)
    count = 0
    for t in c.most_common():
        if t[1] % 2 != 0:
            count = count + 1
    print(count) 

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
A = [int(input()) for _ in range(N)]
ans = 0
for count in Counter(A).items():
    if count[1] % 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 -= {a}
    else:
        s |= {a}
print(len(s))

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# from math import factorial,sqrt,ceil,gcd
# from itertools import permutations as permus
from collections import deque,Counter
# import re
# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

import numpy as np
# import networkx as nx
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix
# from scipy.special import comb

# slist = "abcdefghijklmnopqrstuvwxyz"
N = int(input())
rows = [int(input()) for _ in range(N)]
cnt = Counter(rows)
ans = 0
for k,v in cnt.items():
    if v%2 == 1:
        ans += 1
        
print(ans)
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))

Submission status: Accepted

Solution code:
import collections
import sys
sys.setrecursionlimit(2000000)
# import math
# import itertools
# import statistics
# import numpy as np
n = int(input())
#a = list(map(int, input().split()))
a = []
for i in range(n):
    a.append(int(input()))

ans = collections.Counter(a)

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

print(count)

Submission status: Accepted

Solution code:
N = int(input())
list = set()
for i in range(N):
    i = int(input())
    if i not in list:
        list.add(i)
    elif i in list:
        list.remove(i)
print(len(list))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
import sys
import math

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

h = {}

for i in A:
    h[i] = 0

for j in A:
    h[j] += 1


count = 0
for val in h.values():
    if val % 2 == 1:
        count += 1

print(count)

Submission status: Accepted

Solution code:
from sys import stdin
import sys
import math

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

h = {}

for i in A:
    h[i] = 0

for j in A:
    h[j] += 1


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

print(count)

Submission status: Accepted

Solution code:
from collections import defaultdict
n=int(input())
a=[]
d=defaultdict(int)
D=[]
for i in range(n):
    a.append(input())

for key in a:
    d[key]+=1

for k,v in d.items():
    if v%2==1:
        D.append(k)
print(len(D))